zoukankan      html  css  js  c++  java
  • docker tag 详解

    docker tag 详解

    docker tag 用于给镜像打标签,语法如下:

    docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

    ① 比如我现在有一个 centos 镜像:

    [root@localhost ~]$ docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    centos              latest              1e1148e4cc2c        2 weeks ago         202MB

    ② 我对 centos 进行开发,开发了第一个版本,我就可以对这个版本打标签,打完标签后会生成新的镜像:

    [root@localhost ~]$ docker tag centos centos:v1
    [root@localhost ~]$ docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    centos              latest              1e1148e4cc2c        2 weeks ago         202MB
    centos              v1                  1e1148e4cc2c        2 weeks ago         202MB

    ③ 我继续对 centos 进行开发,开发了第二个版本,继续打标签:

    [root@localhost ~]$ docker tag centos centos:v2
    [root@localhost ~]$ docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    centos              latest              1e1148e4cc2c        2 weeks ago         202MB
    centos              v1                  1e1148e4cc2c        2 weeks ago         202MB
    centos              v2                  1e1148e4cc2c        2 weeks ago         202MB

    ④ 以此类推,每开发一个版本打一个标签,如果以后我想回滚版本,就可以使用指定标签的镜像来创建容器:

    [root@localhost ~]$ docker run -itd centos:v1

     from:https://www.cnblogs.com/pzk7788/p/10180919.html

  • 相关阅读:
    spring mvc 分页
    get/post时中文乱码问题的解决办法
    mysql-day01
    servler配置
    idea
    springMvc 核心配置
    ServletRequest面试题
    Servlet面试题
    Http面试题
    测试文件
  • 原文地址:https://www.cnblogs.com/seasonzone/p/14419983.html
Copyright © 2011-2022 走看看