docker tag 詳解
docker tag 命令的使用,以及如何將本地的鏡像推送到daocloud.io,這里不用docker hub作實(shí)驗(yàn),是因?yàn)椋琩ocker 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,如果沒有賬戶的,需要去網(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é)果
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。