加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

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

发布时间:2020-12-16 03:46:02 所属栏目:安全 来源:网络整理
导读:https://registry.hub.docker.com/_/ubuntu/ 产品名称前面的URL中有一个_. 它是为了什么? 最佳答案 如果您在dockerhub上有一个名为foobar的帐户: # pull from your account (foobar)docker pull foobar/ubuntu:latest 否则,如果省略用户名: # pull from t

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

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

它是为了什么?

最佳答案
如果您在dockerhub上有一个名为foobar的帐户:

# pull from your account (foobar)
docker pull foobar/ubuntu:latest

否则,如果省略用户名:

# pull from the official account (library)
docker pull ubuntu:latest
# almost the same as
docker pull library/ubuntu:latest

下划线(_)是用于发布官方存储库的特殊命名空间.

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读