最佳答案
如果您在dockerhub上有一个名为foobar的帐户:
原文链接:https://www.f2er.com/docker/435861.html# 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