2014-12-03 49 views

回答

8

如果您对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/


唯一的区别是,你会得到不同的图像,名称具有相同的图像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 
+0

谢谢你的好答案。 – 2014-12-03 08:03:51

+0

这只是帮助我,所以我评论如果其他追随者寻求相同的信息。如果您使用的是自助托管的注册表(2.1.1)和透传缓存,则必须使用localhost:5000/library/ubuntu而不是localhost:5000/ubuntu。 – 2015-10-02 14:57:07