Open alexey-igrychev opened 1 month ago
The same issue with crane flatten
command:
$ crane flatten localhost:5000/test --tag localhost:5000/test:flatten
2024/10/29 22:32:01 pushed blob: sha256:2c695611fb1e094624385a8e6f26d9617ea095d295fd879088569f69b48e983c
2024/10/29 22:32:01 existing blob: sha256:2c695611fb1e094624385a8e6f26d9617ea095d295fd879088569f69b48e983c
2024/10/29 22:32:01 pushed blob: sha256:472616afd54c24f0d61cd3dd307cae5ae24aaf2b14a527db49bd38bfd8b9c4e5
2024/10/29 22:32:01 localhost:5001/test:flatten: digest: sha256:19b2ab1c17df3c87b88235dc6b54b6f53766801cb56f0a8a3d65361dea25a096 size: 428
localhost:5001/test@sha256:19b2ab1c17df3c87b88235dc6b54b6f53766801cb56f0a8a3d65361dea25a096
$ crane export localhost:5000/test:flatten - | tar -ztv | grep "test/"
-rw-r--r-- 0 0 0 12 Oct 29 22:12 test/hello2.txt
-rw-r--r-- 0 0 0 12 Oct 29 21:45 test/hello.txt
@imjasonh hello! I think we can fix this but firstly need your approval.
Describe the bug
When using
crane export
to export an image from a registry, deleted files are not ignored despite being removed during the build process.To Reproduce
Create a Dockerfile with the following commands:
Start a local registry:
Build the Docker image:
Push the image to the local registry:
Export the image using
crane
and check for files in thetest
directory:Compare with Docker's export behavior:
Expected behavior
crane export
should ignore deleted files, consistent with Docker's export behavior.Additional context
crane version
: v0.20.2localhost:5000