-
Notifications
You must be signed in to change notification settings - Fork 630
Open
Labels
Description
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:
FROM alpine:3.12 RUN mkdir -p test RUN echo "Hello World" > /test/hello.txt RUN rm -rf /test RUN mkdir -p /test RUN echo "Hello World" > /test/hello2.txt
-
Start a local registry:
docker run -d --name=registry --restart=always -e REGISTRY_STORAGE_DELETE_ENABLED=true -p 5000:5000 registry
-
Build the Docker image:
docker build -t localhost:5000/test . -
Push the image to the local registry:
docker push localhost:5000/test
-
Export the image using
craneand check for files in thetestdirectory:crane export localhost:5000/test - | 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
-
Compare with Docker's export behavior:
docker run --name test localhost:5000/test docker export test | tar -ztv | grep "test/" drwxr-xr-x 0 0 0 0 Oct 29 22:12 test/ -rw-r--r-- 0 0 0 12 Oct 29 22:12 test/hello2.txt
Expected behavior
crane export should ignore deleted files, consistent with Docker's export behavior.
Additional context
- Output of
crane version: v0.20.2 - Registry used (e.g., GCR, ECR, Quay): Local registry on
localhost:5000
Reactions are currently unavailable