千家信息网

如何使用docker tag和docker push

发表于:2025-02-23 作者:千家信息网编辑
千家信息网最后更新 2025年02月23日,这篇文章主要介绍如何使用docker tag和docker push,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!docker tag 详解docker tag 命令的使用,以
千家信息网最后更新 2025年02月23日如何使用docker tag和docker push

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

docker tag 详解

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

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

chenyangdeMacBook-Pro:~ chenyang$ docker imagesREPOSITORY     TAG         IMAGE ID      CREATED       SIZEhello-world     latest       fce289e99eb9    9 weeks ago     1.84 kBchenyangdeMacBook-Pro:~ chenyang$
chenyangdeMacBook-Pro:~ chenyang$ docker imagesREPOSITORY     TAG         IMAGE ID      CREATED       SIZEhello-world     latest       fce289e99eb9    9 weeks ago     1.84 kBchenyangdeMacBook-Pro:~ chenyang$ docker tag fce289e99 hello-world:v1chenyangdeMacBook-Pro:~ chenyang$ docker imagesREPOSITORY     TAG         IMAGE ID      CREATED       SIZEhello-world     latest       fce289e99eb9    9 weeks ago     1.84 kBhello-world     v1         fce289e99eb9    9 weeks ago     1.84 kB

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

chenyangdeMacBook-Pro:~ chenyang$ docker imagesREPOSITORY     TAG         IMAGE ID      CREATED       SIZEhello-world     latest       fce289e99eb9    9 weeks ago     1.84 kBhello-world     v1         fce289e99eb9    9 weeks ago     1.84 kBchenyangdeMacBook-Pro:~ chenyang$ docker tag hello-world:latest hello-world:v2chenyangdeMacBook-Pro:~ chenyang$ docker imagesREPOSITORY     TAG         IMAGE ID      CREATED       SIZEhello-world     latest       fce289e99eb9    9 weeks ago     1.84 kBhello-world     v1         fce289e99eb9    9 weeks ago     1.84 kBhello-world     v2         fce289e99eb9    9 weeks ago     1.84 kB

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

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

chenyangdeMacBook-Pro:~ chenyang$ docker login daocloud.ioUsername (chenyang_1010): chenyang_1010Password: Login SucceededchenyangdeMacBook-Pro:~ chenyang$

打上标签,然后上传

chenyangdeMacBook-Pro:~ chenyang$ docker tag hello-world daocloud.io/zter/hello-world:v1chenyangdeMacBook-Pro:~ chenyang$ docker imagesREPOSITORY           TAG         IMAGE ID      CREATED       SIZEhello-world          latest       fce289e99eb9    9 weeks ago     1.84 kBhello-world          v1         fce289e99eb9    9 weeks ago     1.84 kBhello-world          v2         fce289e99eb9    9 weeks ago     1.84 kBdaocloud.io/zter/hello-world  v1         fce289e99eb9    9 weeks ago     1.84 kBchenyangdeMacBook-Pro:~ chenyang$ docker push daocloud.io/zter/hello-world:v1The push refers to a repository [daocloud.io/zter/hello-world]af0b15c8625b: Pushed v1: digest: sha256:39bbd4a41b5d3b164632d3b4a295c0db31139992a8fe985f949dac7ccff7aa54 size: 524

上传结果

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

0