Docker Hub可以通過其搜索界面或命令行界面搜索Docker Hub注冊表。搜索可以按鏡像名稱,用戶名或描述找到鏡像:
$ docker search centos
NAME DEscriptION STARS OFFICIAL AUTOMATED
centos The official build of CentOS. 1034 [OK]
ansible/centos7-ansible Ansible on Centos7 43 [OK]
tutum/centos Centos image with SSH access. For the root... 13 [OK]
...
在那里,您可以看到兩個示例結(jié)果:centos和ansible/centos7-ansible。第二個結(jié)果顯示它來自名為的用戶的公共存儲庫ansible/,而第一個結(jié)果centos沒有顯式列出存儲庫,這意味著它來自官方映像的頂級命名空間 。該/字符將用戶的存儲庫與映像名稱分開。
找到所需的鏡像后,可以通過以下方式下載docker pull:
$ docker pull centos
latest: Pulling from centos
6941bfcbbfca: Pull complete
41459f052977: Pull complete
fd44297e2ddb: Already exists
centos:latest: The image you are pulling has been verified. important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:d601d3b928eb2954653c59e65862aabb31edefa868bd5148a41fa45004c12288
Status: Downloaded newer image for centos:latest
現(xiàn)在,您有了一個可以運(yùn)行容器的映像。








