Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crane: Image bundle (oci-format) with multple images cannot be pushed using crane push #1717

Closed
svaiyapu opened this issue Jun 1, 2023 · 2 comments
Labels
bug Something isn't working lifecycle/stale

Comments

@svaiyapu
Copy link

svaiyapu commented Jun 1, 2023

Describe the bug

We create an image dir pulling multiple images in a single command (so that layers can be shared). Howover, this
image dir cannot be pushed using crane push, it fails with:

Error: HEAD https://index.docker.io/v2/library/localhost/manifests/sha256:2df55d034b4546d5cec977fba60c7e47fec044e8e5f19855177ece6eba5e04cd: unexpected status code 401 Unauthorized (HEAD responses have no body, use GET for details)

To Reproduce

Here is a transcript of commands

  1. Create an image dir with multiple images in a single crane pull command:
$ crane pull --format oci  \                    
    gcr.io/my-project/image1:tag1 \
    gcr.io/my-project/image2:tag2 \                                     
    /tmp/images-oci  
  1. Now if we try to push this image bundle to a local docker registry it fails. (localhost:5003 is local docker registry endpoint). Using --index option to mention that we have multiple images.
$ crane push /tmp/images-oci/ --index localhost:5003
Error: HEAD https://index.docker.io/v2/library/localhost/manifests/sha256:2df55d034b4546d5cec977fba60c7e47fec044e8e5f19855177ece6eba5e04cd: unexpected status code 401 Unauthorized (HEAD responses have no body, use GET for details)

Expected behavior

We expect both image1 and image2 to be pushed to the local docker registry with digests and tags preserved.

Additional context

None.

  • Output of crane version
    Latest version tested. (tested from version 0.7.0 onwards)
$ /usr/local/bin/crane version
0.10.0
  • Registry used (e.g., GCR, ECR, Quay)

Local docker registry, reachable in localhost:5003

$ docker container list
CONTAINER ID   IMAGE                                    COMMAND                  CREATED         STATUS         PORTS                                       NAMES
5d28306097f3   registry:2                               "/entrypoint.sh /etc…"   3 weeks ago     Up 3 seconds   0.0.0.0:5003->5000/tcp, :::5003->5000/tcp   vsenthil-registry
@svaiyapu svaiyapu added the bug Something isn't working label Jun 1, 2023
@IceCodeNew
Copy link

IceCodeNew commented Jun 13, 2023

I got the same problem here.
There is an air-gap environment I would like to import some images. It would be nice to be able to pack all the images with all architectures of the manifests I want into a single tarball file, and then import images from that tarball.

I managed to get the initial part done with crane, like the following (it seems to be the only way to export multi arches of several images):

rm -rf /export/ \
    && mkdir /export/ \
    && crane --platform all \
        pull --annotate-ref --format oci \
        registry.origin/foo/bar:1.2.3 \
        registry.origin/cat/dog:latest \
        /export/

But I can not specify the target registry with the crane push subcommand:

crane push \
    --index --image-refs test \
    /export/ example.com

Error: HEAD https://index.docker.io/v2/library/example.com/manifests/latest: unexpected status code 401 Unauthorized (HEAD responses have no body, use GET for details)

@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lifecycle/stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants