-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dockerfile:1.7-labs: COPY fails where there exists broken symbolic link and --exclude is specified #4946
Comments
Currently investigating this but I think buildkit/cache/contenthash/checksum.go Lines 409 to 411 in 265d18f
Haven't tested either yet though. |
Seems to be an issue with The reason why this seems to affect We likely just need to avoid following the symlink if there's an error with reading it. |
@aaronlehmann I was wondering if you had any opinions on what the behavior of this should be. To put the problem simply, attempting to compute the checksum of a broken symlink results in an error when it tries to follow the symlink. The buildkit/cache/contenthash/checksum.go Line 413 in 7419743
My thought is to cause broken symlinks fallback to being recorded as themselves rather than following the path when the symlink is broken. This will cause the symlink to be checksummed without an error and an error will get returned later if we attempt to copy a directory that's from a broken symlink. |
That sounds reasonable to me. |
The current plan is to fix this after #4896 has been merged. |
Just ran into this bug too. Now that #4896 is merged, any plans to tackle this? |
I'm planning to tackle this but #4896 made the logic different so it wasn't a simple rebase and I got pulled into some other work in the interim. I am planning to start working on this again soon. |
This also triggers if See also this MCVE with |
Overview:
Hi, i've found that COPY instruction fails where there exists broken symbolic link and --exclude is specified. Wondering if it's a bug.
How to repoduce:
Dockerfile:
build:
docker build can also repoduce:
Result:
It should be:
If i remove the --exclude flag, then the build will succeed without error:
The text was updated successfully, but these errors were encountered: