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

registry.hub.docker.com endpoint doesn't work #2113

Closed
PavloZabudskyi opened this issue Jun 22, 2021 · 10 comments
Closed

registry.hub.docker.com endpoint doesn't work #2113

PavloZabudskyi opened this issue Jun 22, 2021 · 10 comments

Comments

@PavloZabudskyi
Copy link

PavloZabudskyi commented Jun 22, 2021

Problem description

We can't pull/push to registry.hub.docker.com anymore. Was it deprecated?
There are only registry-1.docker.io and registry.docker.io at https://status.docker.com/ mentioned

error parsing HTTP 404 response body: invalid character '<' looking for beginning of value: "<!doctype html>\n<html lang=\"en\">\n\n<head>\n    <meta charset=\"utf-8\">\n    <title>404 : Docker</title>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n    <style>\n    * {\n        line-height: 1.2;\n        margin: 0;\n    }\n\n    html {\n        color: #71859d;\n        display: table;\n        height: 100%;\n        text-align: center;\n        width: 100%;\n    }\n\n    body {\n        background: #fff;\n        display: table-cell;\n        font-family: \"HelveticaNeue-Light\", \"Helvetica Neue Light\", \"Helvetica Neue\", Helvetica, Arial, \"Lucida Grande\", sans-serif;\n        font-weight: 300;\n        margin: 2em auto;\n        vertical-align: middle;\n    }\n\n    a {\n        color: #22b8eb;\n        text-decoration: none;\n    }\n\n\n    @media only screen and (max-width: 280px) {\n        body,\n        p {\n            width: 95%;\n        }\n    }\n\n    #message {\n        font-size: 21px;\n        text-align: center;\n        animation: fadein 2s;\n        -moz-animation: fadein 2s;\n        /* Firefox */\n        -webkit-animation: fadein 2s;\n        /* Safari and Chrome */\n        -o-animation: fadein 2s;\n        /* Opera */\n    }\n\n    @keyframes fadein {\n        from {\n            opacity: 0;\n        }\n        to {\n            opacity: 1;\n        }\n    }\n\n    @-moz-keyframes fadein {\n        /* Firefox */\n        from {\n            opacity: 0;\n        }\n        to {\n            opacity: 1;\n        }\n    }\n\n    @-webkit-keyframes fadein {\n        /* Safari and Chrome */\n        from {\n            opacity: 0;\n        }\n        to {\n            opacity: 1;\n        }\n    }\n\n    @-o-keyframes fadein {\n        /* Opera */\n        from {\n            opacity: 0;\n        }\n        to {\n            opacity: 1;\n        }\n    }\n\n    </style>\n</head>\n<body>\n    <div id=\"message\">\n      <img  src=\" data:image/png;....
@andscho-msft
Copy link

registry.hub.docker.com is returning 301 which redirects to hub.docker.com which then returns 404 and HTML responses.

@ingshtrom
Copy link
Collaborator

This is being investigated. It is recommended that you use registry-1.docker.io to pull/push images from/to Docker Hub and hub.docker.com to reach the UI/non-registry-api parts of Docker Hub, but I don't think we provided an official deprecation notice.

We will fix it for now, but I suggest switching to the domains I mentioned above.

I will let you know once it is fixed.

@mkrakowitzer
Copy link

mkrakowitzer commented Jun 22, 2021

switching to registry-1.docker.io is still giving us 404s when pulling images from our private registry.

edit: private image, not private registry.

@adam-lebon
Copy link

According to docker info, the default registry used by the docker client is index.docker.io

What are the differences with registry-1.docker.io ?

@Callumccr
Copy link

Callumccr commented Jun 22, 2021

Can confirm that both registry-1.docker.io and docker.io are working for private registries for push/pull from/to Docker Hub in Kubernetes with an updated docker-registry secret that points to the new server for imagePullSecrets

@ingshtrom
Copy link
Collaborator

Status Update

Everything looks to be working properly. We did a full rollback as of 13:40 UTC today, so we are at the same state we were at about 24 hours ago.

Docker Pulls working
⛵  docker-desktop in ~ on ☁️  default
❯ docker pull alpine:latest
latest: Pulling from library/alpine
5843afab3874: Pull complete
Digest: sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest

⛵  docker-desktop in ~ on ☁️  default
❯ docker image rm alpine:latest
Untagged: alpine:latest
Untagged: alpine@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0
Deleted: sha256:d4ff818577bc193b309b355b02ebc9220427090057b54a59e73b79bdfe139b83
Deleted: sha256:72e830a4dff5f0d5225cdc0a320e85ab1ce06ea5673acfe8d83a7645cbd0e9cf

⛵  docker-desktop in ~ on ☁️  default
❯ docker pull registry-1.docker.io/library/alpine:latest
latest: Pulling from library/alpine
5843afab3874: Pull complete
Digest: sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0
Status: Downloaded newer image for registry-1.docker.io/library/alpine:latest
registry-1.docker.io/library/alpine:latest

⛵  docker-desktop in ~ on ☁️  default
❯ docker image rm registry-1.docker.io/library/alpine:latest
Untagged: registry-1.docker.io/library/alpine:latest
Untagged: registry-1.docker.io/library/alpine@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0
Deleted: sha256:d4ff818577bc193b309b355b02ebc9220427090057b54a59e73b79bdfe139b83
Deleted: sha256:72e830a4dff5f0d5225cdc0a320e85ab1ce06ea5673acfe8d83a7645cbd0e9cf

⛵  docker-desktop in ~ on ☁️  default
❯ docker pull registry.hub.docker.com/library/alpine:latest
latest: Pulling from library/alpine
5843afab3874: Pull complete
Digest: sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0
Status: Downloaded newer image for registry.hub.docker.com/library/alpine:latest
registry.hub.docker.com/library/alpine:latest

⛵  docker-desktop in ~ on ☁️  default
❯ docker image rm registry.hub.docker.com/library/alpine:latest
Untagged: registry.hub.docker.com/library/alpine:latest
Untagged: registry.hub.docker.com/library/alpine@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0
Deleted: sha256:d4ff818577bc193b309b355b02ebc9220427090057b54a59e73b79bdfe139b83
Deleted: sha256:72e830a4dff5f0d5225cdc0a320e85ab1ce06ea5673acfe8d83a7645cbd0e9cf

⛵  docker-desktop in ~ on ☁️  default
❯ docker pull index.docker.io/library/alpine:latest
latest: Pulling from library/alpine
5843afab3874: Pull complete
Digest: sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest

@mkrakowitzer When you say private registry, do you mean a private image on Docker Hub? If you are truly pulling from a private registry, then you will want to use the URL of that registry, but none of the stuff in this issue should be affecting you, unless you are using it as a pull-through cache for Docker Hub.

@adam-lebon they all point to the same backend services, so really it is only a difference in the hostname which has occurred over many years of changes (much of which predates me). I will inquire further with the corresponding teams as to which hostname is correct and if it isn't index.docker.io, why the engine defaults to that.

@Callumccr thank you, it is good news to see if validated from others as well.

Thank you all, please report if there are any other issues and please include any errors or specific commands you are using to reproduce it.

@elesel
Copy link

elesel commented Jun 22, 2021

Should we look at switching to registry-1.docker.io as a temporary workaround or is that the long-term solution?

@Callumccr
Copy link

Should we look at switching to registry-1.docker.io as a temporary workaround or is that the long-term solution?

+1 on this, will there be a deprecation notice in the future?

@andscho-msft
Copy link

We are making an API call like HEAD /v2/<name>/manifests/<reference>. What is the best-practice FQDN for that API call?

@ingshtrom
Copy link
Collaborator

The recommended hostname to be used to hit the Docker Hub registry is registry-1.docker.io and the recommended hostname to hit Docker Hub UI is hub.docker.com. I said legacy in some posts around the Internet, but I realize these were based off of passed down knowledge throughout the years at Docker without being documented. Thus all hostnames are still valid, but we will be looking to officially document the correct hostnames to be using for all of our products soon. Any deprecation (I'm not saying it's happening, but if it happens) will be communicated through our official channels well in advance likely along with brownout periods.

Sorry for the confusion and inconvenience.

@andscho-msft that would be registry-1.docker.io as that is a request directly to the Docker Hub registry.

opello added a commit to opello/truecharts-charts that referenced this issue Feb 4, 2023
From the perspective of linking to image details on the Docker Hub web
interface, there are two types of images:

  1. Docker Official Images
  2. all of the other images, regardless of their trustworthiness

The Docker Official Images can be referenced several ways, either on the
command line when passed to docker pull, or in the FROM instruction of a
Dockerfile:

  * busybox
  * library/busybox
  * docker.io/busybox
  * docker.io/library/busybox

Furthermore, over the years there have been several domains used for the
official Docker Hub registry:

  * docker.io
  * index.docker.io
  * registry-1.docker.io
  * registry.hub.docker.com

The goal here is handling each possible case, which makes Docker Hub
images more complex than the handling for other registries.

It also makes the case block's '*' (default) case harder to find in the
sequence of glob expressions, but this is necessary to avoid repeating
the parsing or adding another helper function.

Reference:
docker/hub-feedback#2113
docker/cli#3793

Signed-off-by: Dan Christensen <opello@opello.org>
Ornias1993 pushed a commit to truecharts/charts that referenced this issue Feb 9, 2023
* style: Split long lines, follow .editorconfig

Signed-off-by: Dan Christensen <opello@opello.org>

* fix: Clarify why some sources are being excluded

The explanation is also meant to remind anyone that sees it that the
code could inadvertently remove a sources sequence entry that was
intentionally added, because it can not tell.

Signed-off-by: Dan Christensen <opello@opello.org>

* fix: Comment the image-to-URL code

Signed-off-by: Dan Christensen <opello@opello.org>

* refactor: Use case instead of if-ladder

This is a faithful move from the if-ladder to a case statement that
preserves the existing behavior, with optimization to follow.  The
behavior of the function before and after this change is the same.

Signed-off-by: Dan Christensen <opello@opello.org>

* fix: Remove dead code

No "container source" entry from description_list.md has a scheme.  The
values are parsed from the Dockerfiles and would not have one there
either.

Signed-off-by: Dan Christensen <opello@opello.org>

* fix: tccr.io image links

Parse the tccr.io prefix specifically instead of just checking for the
substring tccr which could result in a false positive.

The generated link was also going to point to a truecharts subdirectory
under mirror in the containers repository that does not exist.

Signed-off-by: Dan Christensen <opello@opello.org>

* fix: lscr.io image links

Parse the lscr.io prefix specifically instead of just checking for the
substring lscr which could result in a false positive.

The generated link would also return a 404 because the web interface
requires the image name to be passed in the query string.

Signed-off-by: Dan Christensen <opello@opello.org>

* fix: gcr.io image links

Parse the gcr.io prefix specifically instead of just checking for the
substring gcr which could result in a false positive.

Signed-off-by: Dan Christensen <opello@opello.org>

* feat: Do not add sources if no prefix is created

The intent of this code is to generate URLs to be included in
documentation to attribute inputs to the chart.  If a publicly
accessible URL can not be generated from the image name it makes sense
to not add anything and instead rely on a manual edit to the Chart.yaml.

Signed-off-by: Dan Christensen <opello@opello.org>

* fix: Disable azurecr.io image links

There does not seem to be a general purpose web index to the azurecr.io
hosted images.

Signed-off-by: Dan Christensen <opello@opello.org>

* feat: Disable mcr.microsoft.com image links

Signed-off-by: Dan Christensen <opello@opello.org>

* fix: public.ecr.aws image links

Parse the public.ecr.aws prefix specifically instead of just checking
for the substring public.ecr.aws which could result in a false positive.

Signed-off-by: Dan Christensen <opello@opello.org>

* fix: Disable ocir.io image links

There does not seem to be a general purpose web index to the ocir.io
hosted images.

Signed-off-by: Dan Christensen <opello@opello.org>

* refactor: Add Docker Hub hosted image links

From the perspective of linking to image details on the Docker Hub web
interface, there are two types of images:

  1. Docker Official Images
  2. all of the other images, regardless of their trustworthiness

The Docker Official Images can be referenced several ways, either on the
command line when passed to docker pull, or in the FROM instruction of a
Dockerfile:

  * busybox
  * library/busybox
  * docker.io/busybox
  * docker.io/library/busybox

Furthermore, over the years there have been several domains used for the
official Docker Hub registry:

  * docker.io
  * index.docker.io
  * registry-1.docker.io
  * registry.hub.docker.com

The goal here is handling each possible case, which makes Docker Hub
images more complex than the handling for other registries.

It also makes the case block's '*' (default) case harder to find in the
sequence of glob expressions, but this is necessary to avoid repeating
the parsing or adding another helper function.

Reference:
docker/hub-feedback#2113
docker/cli#3793

Signed-off-by: Dan Christensen <opello@opello.org>

* feat: ghcr.io image links

Signed-off-by: Dan Christensen <opello@opello.org>

* feat: quay.io image links

Signed-off-by: Dan Christensen <opello@opello.org>

* feat: Do not generate likely-bad links

By assuming image names that are not handled by other cases are Docker
Hub images there is a risk of generating bad links.  Minimize this risk
by not generating a link if the image name for a Docker Hub link has two
slashes.  This is a case that should not happen and would likely mean an
unsupported registry is being used.

There is still a risk of an unsupported registry being treated as Docker
Hub and an invalid link being generated.  That case is if the domain and
image name is example.com/busybox where there is only one slash.

Signed-off-by: Dan Christensen <opello@opello.org>

* refactor: Sort cases

Sort the cases from longest to shortest prioritizing any case with a
suffix only glob over any case with a prefix glob.  The intention is to
avoid having a case that can not be reached.

The combined Docker Hub and default case is last.  It might make sense
to split the default case handling off but it does not seem to be a
problem right now.

Signed-off-by: Dan Christensen <opello@opello.org>

---------

Signed-off-by: Dan Christensen <opello@opello.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants