docker hub的url设计的含义是什么?

j-z*_*ang 7 url docker

https://registry.hub.docker.com/_/ubuntu/

_产品名称前面的URL中有一个.

它是为了什么?

kev*_*kev 14

如果您有一个dockerhub名为的帐户foobar:

# pull from your account (foobar)
docker pull foobar/ubuntu:latest
Run Code Online (Sandbox Code Playgroud)

否则,如果省略用户名:

# pull from the official account (library)
docker pull ubuntu:latest
# almost the same as
docker pull library/ubuntu:latest
Run Code Online (Sandbox Code Playgroud)

underscore(_)是一个用于发布官方存储库的特殊命名空间.

https://registry.hub.docker.com/_/ubuntu/https://registry.hub.docker.com/u/library/ubuntu/几乎相同


唯一的区别是您将获得具有相同image-id的不同图像名称:

$ docker pull ubuntu:latest
$ docker pull library/ubuntu:latest
$ docker images

REPOSITORY                                TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
library/ubuntu                            latest              86ce37374f40        7 days ago          192.7 MB
ubuntu                                    latest              86ce37374f40        7 days ago          192.7 MB
Run Code Online (Sandbox Code Playgroud)