Skip to content

crane: push command erroring with "file manifest.json not found in tar" #2109

@Mo0rBy

Description

@Mo0rBy

Describe the bug

I am using buildkit to build my image and then using crane to authenticate to a registry and push the image.

Here are some docs about the buildctl build command, specifically, the output option.

The command I am running to build the image is:

buildctl build \
--frontend dockerfile.v0 \
--local context=. \
--local dockerfile=. \
--output type=oci,dest=my-image.tar

This creates a my-image.tar OCI tarball file in the current working directory.

I am then authenticating to a private AWS ECR using aws ecr get-login-password --region ${region} | crane auth login --username AWS --password-stdin ${ecrRegistryUrl}") and attempting to run crane push my-image.tar ${ecrRegistryUrl}/my-repo/my-image:latest, but I get an error: Error: loading my-image.tar as tarball: file manifest.json not found in tar

To Reproduce

  1. Install buildkit/buildctl for whatever OS you run.
  2. Install crane
  3. Build an image using buildctl build ... and make sure to save it as an OCI tarball using the flags --output type=oci,dest=my-image-tarball.tar
  4. Attempt to push the image using crane push

Expected behavior

I would expect the crane push to work is all.

Anything else

❯ crane version
0.20.5

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