Skip to content

crane: invalid tar header when flattening an image #1622

@svvac

Description

@svvac

Describe the bug

Flattening (some) OCI images fails with the following error:

$ crane flatten docker.io/svvac/test-images:crane-flatten
2023/04/04 13:59:34 pushed blob: sha256:5d6ac85655e6f0fd2304784a31b458b0d10fd6ab199dd28665c30b0b8b5adfcd
2023/04/04 13:59:36 flattening docker.io/svvac/test-images:crane-flatten: uploading layer: Patch "https://index.docker.io/v2/svvac/test-images/blobs/uploads/e19d011a-6a83-4845-a803-89a2257cac7c?_state=<snip>": reading tar: archive/tar: invalid tar header

To Reproduce

Attempt to flatten the image at docker.io/svvac/test-images:crane-flatten (image is public)

Image generation
$ cat >Dockerfile <<EOF
FROM alpine
RUN echo yolo
RUN apk add bash
RUN echo end
EOF
$ docker buildx build --push --tag docker.io/svvac/test-images:crane-flatten

Expected behavior

The image gets flattened

Additional context

Other commands (pull, copy, etc.) work as expected.

  • crane version 0.14.0
  • Registry : Docker hub

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions