• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    docker tag和docker push的使用详解

    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无法正常启动的原因及解决办法
    下一篇:Docker镜像推送(push)到Docker Hub的实现
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯

    时间:9:00-21:00 (节假日不休)

    地址:江苏信息产业基地11号楼四层

    《增值电信业务经营许可证》 苏B2-20120278

    docker tag和docker push的使用详解 docker,tag,和,push,的,使用,