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

ggcr: Unable to copy into Docker Hub when origin image has "3 part" name #1687

Closed
njhale opened this issue May 4, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@njhale
Copy link

njhale commented May 4, 2023

Describe the bug

Copying a private remote image with a name consisting of more than two slash delimited components -- e.g. ghcr.io/njhale/foo/bar:latest -- into a Docker Hub repository with a standard "2 part" name -- docker.io/njhale/bar:latest -- fails with: unexpected status code 400 Bad Request: {"details":"invalid repository name"}.

To Reproduce

  1. Build, tag, and push a private image with a "3 part" name into a registry that supports it, such as GHCR
  2. Use crane copy, setting the destination to a repo in docker.io
$ crane copy ghcr.io/njhale/foo/bar:latest docker.io/njhale/bar:latest

2023/05/04 14:14:37 Copying from ghcr.io/njhale/foo/bar:latest to docker.io/njhale/bar:latest
Error: failed to copy index: Post "https://index.docker.io/v2/njhale/bar/blobs/uploads/?from=njhale%2Ffoo%2Fbar&mount=sha256%3A493e4c0237bba932cb727098a2e21827b39e361ea2795b1b4598752d769a1d7b&origin=ghcr.io": GET https://auth.docker.io/token?scope=repository%3Anjhale%2Fbar%3Apull%2Cpush+repository%3Anjhale%2Ffoo%2Fbar%3Apull&scope=repository%3Anjhale%2Fbar%3Apush%2Cpull&service=registry.docker.io: unexpected status code 400 Bad Request: {"details":"invalid repository name"}

Expected behavior

The image is successfully copied into the target Docker Hub repo.

Additional context

@njhale njhale added the bug Something isn't working label May 4, 2023
@jonjohnsonjr
Copy link
Collaborator

Can you confirm that this is fixed at HEAD?

#1681 should resolve this.

We can cut a release that includes it.

@njhale
Copy link
Author

njhale commented May 4, 2023

Can you confirm that this is fixed at HEAD?

Yup, just checked and this is fixed at HEAD.

We can cut a release that includes it.

That would be awesome, thanks!

@njhale njhale closed this as completed May 4, 2023
@jonjohnsonjr
Copy link
Collaborator

Enjoy: https://github.com/google/go-containerregistry/releases/tag/v0.15.1

njhale added a commit to njhale/runtime that referenced this issue May 5, 2023
Update ggcr to include a fix for
google/go-containerregistry#1687.

Signed-off-by: Nick Hale <4175918+njhale@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants