Docker build sometimes fail on "file not found or excluded by .dockerignore" for a nested ignored file Docker build sometimes fail on "file not found or excluded by .dockerignore" for a nested ignored file docker docker

Docker build sometimes fail on "file not found or excluded by .dockerignore" for a nested ignored file


Disclaimer: I'm not a Node.js developer

Running npm install downloads required Node modules temporarily into .staging folder, so they can be installed. As I understand from your post, node_modules is ignored including its sub-folders. This means .staging folder cannot be accessed anymore.

Another problem you might need to pay attention to (from official Docker docs):

Do not use your root directory as the PATH for your build context,as it causes the build to transfer the entire contents of your harddrive to the Docker daemon.

This could cause conflicts during build