Ask Your Question
1

How does Docker handle symbolic links outside the context?

asked 2022-07-24 11:00:00 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-03-14 14:00:00 +0000

scrum gravatar image

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.

edit flag offensive delete link more

Your Answer

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

Add Answer


Question Tools

Stats

Asked: 2022-07-24 11:00:00 +0000

Seen: 15 times

Last updated: Mar 14 '23