构建完镜像,这个镜像只是存在于我们的宿主机上面,我们也可以将它上传到Docker Hub 上面去,这样其他人也可以看到这个镜像了。
使用命令docker push 仓库名/镜像名
[root@VM-0-16-centos ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
wendianfei/static_web latest 2944f46ad47a 3 days ago 146MB
wendianfei/testnginx latest 8e20368e07b2 3 days ago 138MB
ubuntu latest bb0eaf4eee00 7 months ago 72.9MB
nginx latest 7e4d58f0e5f3 7 months ago 133MB
macadmins/puppetmaster latest eeb5ef90b871 3 years ago 425MB
ubuntu 12.04 5b117edd0b76 4 years ago 104MB
ubuntu precise 5b117edd0b76 4 years ago 104MB
[root@VM-0-16-centos ~]#
[root@VM-0-16-centos ~]#
[root@VM-0-16-centos ~]# docker push wendianfei/static_web
The push refers to repository [docker.io/wendianfei/static_web]
8c0e5dcab5b4: Pushed
727c72250cd7: Pushed
3efd1f7c01f6: Mounted from library/ubuntu
73b4683e66e8: Mounted from library/ubuntu
ee60293db08f: Mounted from library/ubuntu
9dc188d975fd: Mounted from library/ubuntu
58bcc73dcf40: Mounted from library/ubuntu
latest: digest: sha256:11a1bc087da72ca8456f85420177092d7dcf55f7fa6c0dc5fce12c1e65f865eb size: 1778
上传完之后登陆https://hub.docker.com/
打开My Profile 就能看到我们上传的镜像。