DockerPush

 

1.阿里雲鏡像發佈流程

 

2.鏡像生成

語法:docker commit [OPTIONS] 容器ID [REPOSITORY[:TAG]]

[root@pluto data]# docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE

centos              6.81                68f963fbef95        4 seconds ago       380.9 MB

 

[root@pluto data]# docker run -it centos:centos6.81

ctrl+p+q

 

[root@pluto data]# docker commit -a pluto -m "new centos6.82 with vim and ifconfig" 097f44f346e3 centos:6.82

 

[root@pluto data]# docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE

centos              6.82                68f963fbef95        4 seconds ago       380.9 MB

3.將鏡像push到阿里雲

[1].鏡像原型

[root@pluto data]# docker images

REPOSITORY                                         TAG                 IMAGE ID            CREATED             VIRTUAL SIZE

centos                                             6.82                68f963fbef95        35 minutes ago      380.9 MB

[2].創建倉庫鏡像

(1).創建命名空間

 

(2).創建鏡像倉庫

  

[3].鏡像推送到registry

$ sudo docker login --username=13023490952 registry.cn-shenzhen.aliyuncs.com

$ sudo docker tag [ImageId] registry.cn-shenzhen.aliyuncs.com/pluto_h/centostest:[鏡像版本號]

$ sudo docker push registry.cn-shenzhen.aliyuncs.com/pluto_h/centostest:[鏡像版本號]

 

 

(1).login

[root@pluto /]# sudo docker login --username=13023490952 registry.cn-shenzhen.aliyuncs.com

WARNING: login credentials saved in /root/.docker/config.json

Login Succeeded

  因爲我之前登陸過,所以可以不輸入密碼,否則會提示輸入密碼

(2).tag

[root@pluto /]# docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE

centos              6.82                68f963fbef95        50 minutes ago      380.9 MB

[root@pluto /]#  sudo docker tag 68f963fbef95 registry.cn-shenzhen.aliyuncs.com/pluto_h/centostest:6.82.1

(3).push

[root@pluto /]# sudo docker push registry.cn-shenzhen.aliyuncs.com/pluto_h/centostest:6.82.1

[root@pluto /]# docker images

REPOSITORY                                             TAG                 IMAGE ID            CREATED             VIRTUAL SIZE

registry.cn-shenzhen.aliyuncs.com/pluto_h/centostest   6.82.1              68f963fbef95        59 minutes ago      380.9 MB

[4].查詢鏡像

 

[5].查看詳情

 

4.pull到docker

 

[root@pluto /]# docker pull registry.cn-shenzhen.aliyuncs.com/pluto_h/centostest:6.82.1

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章