The main reason to use a .dockerignore file is because the docker command has to send your complete build-context to the docker daemon, which will then build the image.
If your context is the root of the repo for instance, it will send your whole project to the daemon before evaluating the COPY and ADD commands. This can become expensive when you have a lot of dependencies or store build artifacts in your project.
.dockerignore stops the docker CLI from sending specified files and directories to the daemon.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The main reason to use a
.dockerignorefile is because the docker command has to send your complete build-context to the docker daemon, which will then build the image.If your context is the root of the repo for instance, it will send your whole project to the daemon before evaluating the
COPYandADDcommands. This can become expensive when you have a lot of dependencies or store build artifacts in your project..dockerignorestops the docker CLI from sending specified files and directories to the daemon.