1、在 https://hub.docker.com/ 注册账号
登录后,选择 for public repos
创建 Respository
2、在环境上登陆刚注册的账号,我的是 dockerisup
[root@cloud-container ~]# docker login -u dockerisup
Password:
Login Succeeded
[root@cloud-container ~]#
使用 docker tag httpd dockerisup/httpd:v1 (dockerid/imagename:tag)来区分不同仓库的镜像
docker push dockerisup/httpd 上传镜像
root@cloud-container ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/httpd latest c5a012f9cf45 5 weeks ago 165 MB
docker.io/centos latest 470671670cac 2 months ago 237 MB
docker.io/hello-world latest fce289e99eb9 15 months ago 1.84 kB
[root@cloud-container ~]# docker tag httpd dockerisup/httpd:v1
[root@cloud-container ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/httpd latest c5a012f9cf45 5 weeks ago 165 MB
dockerisup/httpd v1 c5a012f9cf45 5 weeks ago 165 MB
docker.io/centos latest 470671670cac 2 months ago 237 MB
docker.io/hello-world latest fce289e99eb9 15 months ago 1.84 kB
[root@cloud-container ~]# docker push dockerisup/httpd
The push refers to a repository [docker.io/dockerisup/httpd]
25a92d79dbfe: Mounted from library/httpd
b5432b464616: Pushed
e6699b4fc2e3: Pushed
762ba19e7ef1: Mounted from library/httpd
f2cb0ecef392: Pushed
v1: digest: sha256:d3df077ec2ddbe0a62279c672b9c792055b96f6d22ed1e45371bcd70393730f9 size: 1367
3、在dokcer hub上查看镜像