hub-feedback icon indicating copy to clipboard operation
hub-feedback copied to clipboard

Manifest endpoint https://docker.io/v2/francium25/base/manifests/latest redirects to 404

Open chanseokoh opened this issue 6 years ago • 14 comments

Accessing

https://docker.io/v2/francium25/base/manifests/latest

returns 301 to redirect to

https://www.docker.com/v2/francium25/base/manifests/latest

which gives a 404 HTML page. Should it direct to, e.g.,

https://registry.hub.docker.com/v2/francium25/base/manifests/latest

?

So, it causes a failure when a user specifies an image reference in the form of docker.io/repository/image. (https://github.com/GoogleContainerTools/jib/issues/1549) Detailed HTTP requests and responses:

Mar 11, 2019 5:27:26 PM com.google.api.client.http.HttpRequest execute
CONFIG: -------------- REQUEST  --------------
GET https://docker.io/v2/francium25/base/manifests/latest
Accept: application/vnd.oci.image.manifest.v1+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.docker.distribution.manifest.v1+json
Accept-Encoding: gzip
User-Agent: jib 1.0.0 jib-maven-plugin Google-HTTP-Java-Client/1.23.0 (gzip)

Mar 11, 2019 5:27:26 PM com.google.api.client.http.HttpRequest execute
CONFIG: curl -v --compressed -H 'Accept: application/vnd.oci.image.manifest.v1+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.docker.distribution.manifest.v1+json' -H 'Accept-Encoding: gzip' -H 'User-Agent: jib 1.0.0 jib-maven-plugin Google-HTTP-Java-Client/1.23.0 (gzip)' -- 'https://docker.io/v2/francium25/base/manifests/latest'
Mar 11, 2019 5:27:26 PM com.google.api.client.http.HttpResponse <init>
CONFIG: -------------- RESPONSE --------------
HTTP/1.1 301 Moved Permanently
Content-length: 0
Location: https://www.docker.com/v2/francium25/base/manifests/latest

Mar 11, 2019 5:27:26 PM com.google.api.client.http.HttpRequest execute
CONFIG: -------------- REQUEST  --------------
GET https://www.docker.com/v2/francium25/base/manifests/latest
Accept: application/vnd.oci.image.manifest.v1+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.docker.distribution.manifest.v1+json
Accept-Encoding: gzip
User-Agent: jib 1.0.0 jib-maven-plugin Google-HTTP-Java-Client/1.23.0 (gzip)

Mar 11, 2019 5:27:26 PM com.google.api.client.http.HttpRequest execute
CONFIG: curl -v --compressed -H 'Accept: application/vnd.oci.image.manifest.v1+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.docker.distribution.manifest.v1+json' -H 'Accept-Encoding: gzip' -H 'User-Agent: jib 1.0.0 jib-maven-plugin Google-HTTP-Java-Client/1.23.0 (gzip)' -- 'https://www.docker.com/v2/francium25/base/manifests/latest'
Mar 11, 2019 5:27:27 PM com.google.api.client.http.HttpResponse <init>
CONFIG: -------------- RESPONSE --------------
HTTP/1.1 404 Not Found

chanseokoh avatar Mar 11 '19 21:03 chanseokoh

The correct URL is https://registry-1.docker.io/v2/francium25/base/manifests/latest

manishtomar avatar Mar 11 '19 21:03 manishtomar

I see. So, suppose that I'm writing a CLI tool to push a local image docker.io/francium25/base to Docker Hub. Then, you are suggesting the tool should contact registry-1.docker.io as a workaround?

In any case, I think it is still incorrect to redirect the URL to 404.

chanseokoh avatar Mar 11 '19 21:03 chanseokoh

Then, you are suggesting the tool should contact registry-1.docker.io as a workaround?

Can I have the tool depend on this contract? For example, this won't break in the future?

chanseokoh avatar Mar 11 '19 21:03 chanseokoh

I found only two doc pages that explicitly reference registry-1.docker.io as the Docker Registry API endpoint: "Certify Docker Image", and "Registry as a pull through cache". Though other places on the web recommend using registry.docker.io.

It would be nice if https://docker.io/v2/ redirected to the right place rather than requiring tools maintain magic mappings.

briandealwis avatar Mar 12 '19 14:03 briandealwis

I think docker.io/library/alpine is canonical name understood by engine which translates it to registry-1.docker.io. However I agree there should be one name that does the right redirect. I think multiple URLs are a historical mistake that are too scary to change due to its impact of breaking many tools.

@thajeztah do you know the relationship between docker.io, registry.docker.io and registry-1.docker.io?

manishtomar avatar Mar 12 '19 17:03 manishtomar

And index.docker.io too :-)

briandealwis avatar Mar 12 '19 18:03 briandealwis

@manishtomar hm, no, unfortunately not. Have been wondering a few times myself as well which one is the canonical URL (there's some hard-coded values in the engine code-base that could be updated as well)

thaJeztah avatar Mar 13 '19 00:03 thaJeztah

It's also odd that registry.docker.io is a CNAME to registry-1.docker.io, but attempts to use it as a registry fail due to 503 Service Unavailable errors.

briandealwis avatar Mar 14 '19 17:03 briandealwis

We are clearing up our old issues and your ticket has been open for one year with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar May 08 '21 01:05 github-actions[bot]

The issue still stands.

chanseokoh avatar May 10 '21 14:05 chanseokoh

We are clearing up our old issues and your ticket has been open for 6 months with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar Nov 07 '21 00:11 github-actions[bot]

HUB-4585 is tracking this internally (sorry, that link is to the private jira)

thaJeztah avatar Nov 08 '21 09:11 thaJeztah

We are clearing up our old issues and your ticket has been open for 6 months with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar May 08 '22 00:05 github-actions[bot]

.

thaJeztah avatar May 09 '22 10:05 thaJeztah