2014-12-03 26 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