1.阿里雲鏡像發佈流程docker
2.鏡像生成json
語法:docker commit [OPTIONS] 容器ID [REPOSITORY[:TAG]]vim
[root@pluto data]# docker imagescentos REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE阿里雲 centos 6.81 68f963fbef95 4 seconds ago 380.9 MBspa
[root@pluto data]# docker run -it centos:centos6.813d ctrl+p+qblog
[root@pluto data]# docker commit -a pluto -m "new centos6.82 with vim and ifconfig" 097f44f346e3 centos:6.82ci
[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 |