Docker push命令推送镜像到远端仓库

这里以dockercloud.io仓库为例,首先在docker配置文件中配置远端仓库地址,传送门如下:

Docker运维与实战(一)-Docker的前世今生

1、登录远端仓库

$ docker login 10.12.1.202:8088
Username: zhangzhixiang
Password: 
Login Succeeded

2、打标签

$ docker tag hello-world daocloud.io/oascloud/hello-world:v1
chenyangdeMacBook-Pro:~ chenyang$ docker images
REPOSITORY                     TAG                 IMAGE ID            CREATED             SIZE
hello-world                    latest              fce289e99eb9        9 weeks ago         1.84 kB
hello-world                    v1                  fce289e99eb9        9 weeks ago         1.84 kB
hello-world                    v2                  fce289e99eb9        9 weeks ago         1.84 kB
daocloud.io/zter/hello-world   v1                  fce289e99eb9        9 weeks ago         1.84 kB

3、推送镜像到远端仓库

$ docker push daocloud.io/oascloud/hello-world:v1
The push refers to a repository [daocloud.io/zter/hello-world]
af0b15c8625b: Pushed 
v1: digest: sha256:39bbd4a41b5d3b164632d3b4a295c0db31139992a8fe985f949dac7ccff7aa54 size: 524
发布了341 篇原创文章 · 获赞 376 · 访问量 36万+

猜你喜欢

转载自blog.csdn.net/qq_19734597/article/details/103740652