You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 3, 2025. It is now read-only.
Description
In case of symlink files across multi-stage files, kaniko would only detect change in the symlink.
Logs suggested, it only saved the symlink and not the target. Due to which user saw a build failure.
INFO[0000] Resolved base name alpine:3.11 to alpine:3.11
INFO[0000] Resolved base name scratch to scratch
INFO[0000] Resolved base name alpine:3.11 to alpine:3.11
....
INFO[0015] Taking snapshot of full filesystem...
INFO[0017] Saving file /usr/lib/libstdc++.so.6 for later use.
....
INFO[0018] COPY --from=0 /usr/lib/libstdc++.so.6 /usr/lib/
error building image: error building stage: failed to execute command: symlink libstdc++.so.6.0.27 /usr/lib/libstdc++.so.6: no such file or directory
In this change,
For symlinks, we identify the symlink as well as the target as files to saved
/ # /kaniko/executor -f dockerfiles/Dockerfile_test_copy_symlink --context=dir:///workspace --destination=gcr.io/tejal-test/test --tarPath=image.tar
....
INFO[0004] Taking snapshot of full filesystem...
INFO[0004] Adding whiteout for /kaniko
INFO[0007] Saving file /usr/lib/libstdc++.so.6.0.27 for later use
INFO[0007] Saving file /usr/lib/libstdc++.so.6 for later use
INFO[0007] Deleting filesystem...
INFO[0007] No base image, nothing to extract
INFO[0007] Unpacking rootfs as cmd COPY --from=t /usr/lib/libstdc++.so.6 /usr/lib/ requires it.
INFO[0007] Taking snapshot of full filesystem...
INFO[0008] COPY --from=t /usr/lib/libstdc++.so.6 /usr/lib/
INFO[0008] Taking snapshot of files...
When a symlink is copied across mutliple stages, the target file is also copies.
Success log above.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
I looked at the PR and looks like for symlinks, it fixes copy by copying the target file when a symlink is copied. The code does not change what file is saved.
For cross stage references, for symlink is referenced, we should save both symlink as well as target.
WDYT?
i will check what docker does when copying a symlink and update this section.
I looked at the PR and looks like for symlinks, it fixes copy by copying the target file when a symlink is copied. The code does not change what file is saved.
For cross stage references, for symlink is referenced, we should save both symlink as well as target.
WDYT?
i will check what docker does when copying a symlink and update this section.
Ya I agree, I think they are addressing two similar but different issues.
This PR: src is a symlink
That PR: dest is a symlink
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #915
Description
In case of symlink files across multi-stage files, kaniko would only detect change in the symlink.
Logs suggested, it only saved the symlink and not the target. Due to which user saw a build failure.
In this change,
Success log above.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
will do.
See the contribution guide for more details.
Reviewer Notes
Release Notes
Describe any changes here so maintainer can include it in the release notes, or delete this block.