资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

如何使用dockertag和dockerpush

这篇文章主要介绍如何使用docker tag和docker push,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

成都创新互联是工信部颁发资质IDC服务器商,为用户提供优质的成都机柜租用服务

docker tag 详解

docker tag 命令的使用,以及如何将本地的镜像推送到daocloud.io,这里不用docker hub作实验,是因为,docker hub网速不给力,容易推送失败。

使用docker tag使用镜像ID重命名

chenyangdeMacBook-Pro:~ chenyang$ docker images
REPOSITORY     TAG         IMAGE ID      CREATED       SIZE
hello-world     latest       fce289e99eb9    9 weeks ago     1.84 kB
chenyangdeMacBook-Pro:~ chenyang$
chenyangdeMacBook-Pro:~ chenyang$ docker images
REPOSITORY     TAG         IMAGE ID      CREATED       SIZE
hello-world     latest       fce289e99eb9    9 weeks ago     1.84 kB
chenyangdeMacBook-Pro:~ chenyang$ docker tag fce289e99 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

使用docker tag使用镜像tag重命名

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
chenyangdeMacBook-Pro:~ chenyang$ docker tag hello-world:latest hello-world:v2
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

使用docker push 推送镜像到daocloud.io

需要登陆daocloud.io,如果没有账户的,需要去网站上注册一个。

chenyangdeMacBook-Pro:~ chenyang$ docker login daocloud.io
Username (chenyang_1010): chenyang_1010
Password: 
Login Succeeded
chenyangdeMacBook-Pro:~ chenyang$

打上标签,然后上传

chenyangdeMacBook-Pro:~ chenyang$ docker tag hello-world daocloud.io/zter/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
chenyangdeMacBook-Pro:~ chenyang$ docker push daocloud.io/zter/hello-world:v1
The push refers to a repository [daocloud.io/zter/hello-world]
af0b15c8625b: Pushed 
v1: digest: sha256:39bbd4a41b5d3b164632d3b4a295c0db31139992a8fe985f949dac7ccff7aa54 size: 524

上传结果

如何使用docker tag和docker push

以上是“如何使用docker tag和docker push”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注创新互联行业资讯频道!


分享标题:如何使用dockertag和dockerpush
文章源于:http://cdkjz.cn/article/ijoojp.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220