Docker does not handle symbolic links outside the context by default. When building a Docker image, only the files and directories inside the build context are copied into the image. Any symbolic links to files or directories outside the build context will not be resolved by Docker.
However, it is possible to explicitly specify files or directories outside the build context using the ADD
or COPY
instruction with an absolute path. In this case, Docker will follow the symbolic links and copy the target files or directories into the image.
It is important to note that using absolute paths outside the build context can potentially cause security risks, as sensitive files or directories outside the build context may be copied into the image. Therefore, it is recommended to use relative paths within the build context whenever possible.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-07-24 11:00:00 +0000
Seen: 15 times
Last updated: Mar 14 '23