-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Difference between docker build and kaniko executor when copying symlinks #1382
Comments
We have had a lot of debate on this in previous issues like #915 and #1038 In #1038, user mentioned, docker copies a symlink or else their image size is doubled.
It would help us not bring in a regression. Thanks |
From what I have tested:
tricky one |
Might be related #1406 |
I have another real world example to trigger this bug. I am using git-sync to retrieve the sources for the build. So I end up with something like this in my Kaniko pod:
In /src/my_app/Dockerfile I have a line:
which will copy the content of /srv/rev-13ae93985486f802c884339988aade8273b84fc8 to the /src directory of the new image However, when I run Kaniko with "--context=/src/my_app" the symlink is copied to the target folder so I end up with
Note: The symlink is not part of what is actually copied. I is just the location under which the files to copy are accessed. P.S.: COPY * ./ shows the same behavior so does ADD. |
Some tools, like kaniko, don't have the same behavior as Docker with regards to copying symlinks in multi-stage builds. See: GoogleContainerTools/kaniko#1382
Actual behavior
When having a symlink in the context dir that point to a file to a subfolder and adding it with COPY, docker build copy the content of the file but kaniko executor copy the symlink instead.
Expected behavior
Kaniko executor will copy the content of the file as docker build does.
To Reproduce
Steps to reproduce the behavior:
Given the following environment:
and the following dockerfile:
Here is the docker build output
And now using Kaniko:
Additional Information
you need a file that is a symlink to another one (see reproduce part above)
gcr.io/kaniko-project/executor:debug-v0.23.0
(id: 390df83ff1ab)The text was updated successfully, but these errors were encountered: