I have one Rockerfile that builds 4 images; I also have one central .dockerignore file. For one of the images I require assets that are blocked by the .dockerignore file -- is there a way when doing ADD or COPY to force add / ignore this list?
It'll be a lot easier to do this in one file as opposed to three separate...!
In a simple way no.
The
.dockerignorefile is used to filter what will be used in the build before even reading theDockerfile.The
docker daemondoes not see your build folder, when the build starts, all the files in the context build folder are compressed (or just packed) and send to the daemon and only then it will read yourDockerfileto build the container with the files it received.More content about
.dockerignore: https://docs.docker.com/engine/reference/builder/#/dockerignore-file