zoukankan      html  css  js  c++  java
  • 基于已有镜像的容器创建镜像

    启动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
    
  • 相关阅读:
    一个省一等奖没文件没证书,只能保存一张图呢
    HTML5的新结构标签
    一个最简单的网页是如何构成的
    数据模型层Model
    空控制器空操作
    TP框架
    thinkphp基础
    静态缓存
    smarty函数
    Smarty的使用
  • 原文地址:https://www.cnblogs.com/Genesis2018/p/8304723.html
Copyright © 2011-2022 走看看