Docker official registry (Docker Hub) URL

2019-03-14 11:37发布

Docker Hub official website has been moved to https://registry.hub.docker.com from https://hub.docker.com/.

If I try to docker pull images from URL like: docker pull registry.hub.docker.com/busybox it shows:

registry.hub.docker.com/busybox: this image was pulled from a legacy registry.  
Important: This registry version will not be supported in future versions of docker.

But if I use docker pull registry.hub.docker.com/busybox.

It cannot pull the image.

Same situation when using curl -k https://registry.hub.docker.com/v1/repositories/busybox/tags

5条回答
乱世女痞
2楼-- · 2019-03-14 12:05

The registry path for official images (without a slash in the name) is library/<image>. Try this instead:

docker pull registry.hub.docker.com/library/busybox
查看更多
Anthone
3楼-- · 2019-03-14 12:16

It's just docker pull busybox, are you using an up to date version of the docker client. I think they stopped supporting clients lower than 1.5.

Incidentally that curl works for me:

$ curl -k https://registry.hub.docker.com/v1/repositories/busybox/tags
[{"layer": "fc0db02f", "name": "latest"}, {"layer": "fc0db02f", "name": "1"}, {"layer": "a6dbc8d6", "name": "1-ubuntu"}, {"layer": "a6dbc8d6", "name": "1.21-ubuntu"}, {"layer": "a6dbc8d6", "name": "1.21.0-ubuntu"}, {"layer": "d7057cb0", "name": "1.23"}, {"layer": "d7057cb0", "name": "1.23.2"}, {"layer": "fc0db02f", "name": "1.24"}, {"layer": "3d5bcd78", "name": "1.24.0"}, {"layer": "fc0db02f", "name": "1.24.1"}, {"layer": "1c677c87", "name": "buildroot-2013.08.1"}, {"layer": "0f864637", "name": "buildroot-2014.02"}, {"layer": "a6dbc8d6", "name": "ubuntu"}, {"layer": "ff8f955d", "name": "ubuntu-12.04"}, {"layer": "633fcd11", "name": "ubuntu-14.04"}]

Interesting enough if you sniff the headers you get a HTTP 405 (Method not allowed). I think this might be to do with the fact that Docker have deprecated their Registry API.

查看更多
何必那么认真
4楼-- · 2019-03-14 12:19

I cam accross this post in search for the dockerhub repo url when creating a dockerhub kubernetes secret.. figured id share the url is used with success, hope thats ok.

this worked for me: https://index.docker.io/v1/

查看更多
放荡不羁爱自由
5楼-- · 2019-03-14 12:20

You're able to get the current registry-url using docker info:

...
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
...

That's also the url you may use to run your self hosted-registry:

docker run -d -p 5000:5000 --name registry -e REGISTRY_PROXY_REMOTEURL=https://index.docker.io registry:2
查看更多
Lonely孤独者°
6楼-- · 2019-03-14 12:21

For those trying to create a Google Cloud instance using the "Deploy a container image to this VM instance." option then the correct url format would be

docker.io/<dockerimagename>:version

The suggestion above of registry.hub.docker.com/library/<dockerimagename> did not work for me.

I finally found the solution here (in my case, i was trying to run docker.io/tensorflow/serving:latest)

查看更多
登录 后发表回答