Describe the bug
Make a file and create a hard link to it, if this file is not the first file in tar (In general, it is in dictionary order).
And then modify this file, the content from crane export of the hard link file will be wrong.
To Reproduce
FROM busybox
RUN echo 123 > t2
RUN ln t2 t1 && ln t2 t3
RUN echo 456 > t1
# prepare dockerfile
docker build . -t xxx
docker push xxx
crane export xxx image.tar && tar xf image.tar
cat t1 t2 t3
or I have built a image and pushed to dockerhub,
just use it
crane export hunsh/ggcr-extract-hardlink image.tar && tar xf image.tar
cat t1 t2 t3
will get output
Expected behavior
Additional context
It's related to #977
Add any other context about the problem here.
- Output of
crane version: 0.20.2
- Registry used (e.g., GCR, ECR, Quay)
Describe the bug
Make a file and create a hard link to it, if this file is not the first file in tar (In general, it is in dictionary order).
And then modify this file, the content from
crane exportof the hard link file will be wrong.To Reproduce
or I have built a image and pushed to dockerhub,
just use it
will get output
Expected behavior
Additional context
It's related to #977
Add any other context about the problem here.
crane version: 0.20.2