Skip to content
Discussion options

You must be logged in to vote

This is expected from BuildKit's current context-filesystem implementation, although it is different from the legacy builder's host-filesystem dereference behavior.

First, the symlink in the reproducer is broken from the host's point of view:

$tmp/context/Dockerfile -> ../file

resolves to $tmp/file, not $tmp/context/file. The existing file would be targeted by Dockerfile -> file.

BuildKit does not dereference that path directly against the host filesystem. When loading the Dockerfile, the frontend requests it with llb.FollowPaths. The fsutil resolver treats the build context as a rooted virtual filesystem, so absolute paths and .. components cannot escape the context. In this case, ../file

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@eriksjolund
Comment options

Answer selected by eriksjolund
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants