Wanted to double check my interpretation…
-
Are the
.dockerignoreonly used when sending the context as a whole? -
Can
.dockerignorefiles be placed in subfolders?
Thanks everyone!
Share and learn in the Docker community.
Wanted to double check my interpretation…
Are the .dockerignore only used when sending the context as a whole?
Can .dockerignore files be placed in subfolders?
Thanks everyone!
Yes, .dockerignore is used for ADD/COPY as well, see documentation:
This helps to avoid unnecessarily sending large or sensitive files and directories to the daemon and potentially adding them to images using
ADDorCOPY.
Can
.dockerignorefiles be placed in subfolders?
See documentation:
Before the docker CLI sends the context to the docker daemon, it looks for a file named
.dockerignorein the root directory of the context
It doesn’t look in subfolders. I checked it (using Docker version 17.12.0-ce, build c97c6d6).