DockerPush
阅读原文时间:2023年07月08日阅读:1

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

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章