• 基于已有镜像的容器创建镜像


    启动Docker

    [root@localhost ~]# docker ps
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
    [root@localhost ~]# docker ps -a
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                    PORTS               NAMES
    db70bb3f6068        centos              "/bin/bash"         27 hours ago        Exited (0) 27 hours ago                       serene_wright
    [root@localhost ~]# docker start db70bb3f6068
    db70bb3f6068
    [root@localhost ~]# docker ps -a
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
    db70bb3f6068        centos              "/bin/bash"         28 hours ago        Up 55 minutes                           serene_wright
    [root@localhost ~]# docker exec -it db70bb3f6068 /bin/bash
    [root@db70bb3f6068 /]#
    

    更改

    [root@db70bb3f6068 /]# wget
    bash: wget: command not found
    [root@db70bb3f6068 /]# yum install -y net-tools wget
    

    提交新镜像

    [root@db70bb3f6068 /]# exit
    exit
    [root@localhost ~]# docker commit -m "cantos_with_nettools_and_wget" -a "root" db70bb3f6068 centos_with_net
    [root@localhost ~]# docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
    centos_with_net     latest              3e8ea8607f08        24 seconds ago      294.9 MB
    centos              latest              9baab0af79c4        9 days ago          196.7 MB
    
  • 相关阅读:
    10多媒体
    胡凡-01
    概念
    算法
    07Axios
    05VueCli
    04Vue.js路由系统
    03生命周期
    《穷人思维》学习感悟
    《基金》学习感悟之二
  • 原文地址:https://www.cnblogs.com/Genesis2018/p/9079803.html
Copyright © 2020-2023  润新知