這篇文章主要介紹如何使用docker tag和docker push,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!
成都創(chuàng)新互聯(lián)是工信部頒發(fā)資質(zhì)IDC服務(wù)器商,為用戶(hù)提供優(yōu)質(zhì)的成都機(jī)柜租用服務(wù)
docker tag 詳解
docker tag 命令的使用,以及如何將本地的鏡像推送到daocloud.io,這里不用docker hub作實(shí)驗(yàn),是因?yàn)?,docker hub網(wǎng)速不給力,容易推送失敗。
使用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,如果沒(méi)有賬戶(hù)的,需要去網(wǎng)站上注冊(cè)一個(gè)。
chenyangdeMacBook-Pro:~ chenyang$ docker login daocloud.io Username (chenyang_1010): chenyang_1010 Password: Login Succeeded chenyangdeMacBook-Pro:~ chenyang$
打上標(biāo)簽,然后上傳
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
上傳結(jié)果
以上是“如何使用docker tag和docker push”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!