Hard linked files broken when copied from previous stage #1743
Labels
area/dockerfile-command
For all bugs related to dockerfile file commands
area/multi-stage builds
issues related to kaniko multi-stage builds
categorized
cmd/copy
differs-from-docker
interesting
issue/big-image
issue/hard-link
kind/bug
Something isn't working
priority/p0
Highest priority. Break user flow. We are actively looking at delivering it.
works-with-docker
Actual behavior
When Kaniko copies a directory from a previous stage with
COPY --from=...
if the directory contains files with hard links to each other, the files copied do not have hard links. As a result, in the worst cases, I have seen the size of images built by Kaniko that contain many hard links be close to twice the size of the same image built by Docker.Expected behavior
When Kaniko copies a directory from a previous stage with
COPY --from=...
if the directory contains files with hard links to each other, the files copied should have hard links to each other as well.To Reproduce
Use
COPY --from=
within a dockerfile to copy a directory from a previous stage that contains hard linked files.Additional Information
Note:
ls -lahi
shows the inode of the file in the first column. The inodes for hard linked files are always identical.When built with Docker, the files are properly hard linked in stage1 and the final stage.
When built with Kaniko, the files are properly hard linked in stage1 but not in the final stage. The inodes of a and b are 525926952 and 525926957.
None
gcr.io/kaniko-project/executor:latest 1c812ffa8ec1
Triage Notes for the Maintainers
--cache
flagThank you for your time Kaniko team!
The text was updated successfully, but these errors were encountered: