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上查看鏡像