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

    Docker 基于已有镜像的容器创建镜像:
    
    
    docker:/root# docker run -it januswel/centos  /bin/bash
    
    
     
    docker exec -it januswel/centos  /bin/bash
    
    
    docker:/root# docker start 13fe7a3f05cc
    13fe7a3f05cc
    
    
    后台运行:
    docker:/root# docker exec -it 13fe7a3f05cc /bin//bash
    [root@13fe7a3f05cc /]# 
    
    
    
    docker:/root# docker ps
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
    13fe7a3f05cc        januswel/centos     "/bin/bash"         3 hours ago         Up About a minute                       boring_torvalds 
    
    
    
    
    查看容器版本:
    
    [root@13fe7a3f05cc /]# cat /etc/redhat-release 
    CentOS Linux release 7.2.1511 (Core)
    
    [root@13fe7a3f05cc /]# ifconfig -a
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 172.17.0.2  netmask 255.255.0.0  broadcast 0.0.0.0
            inet6 fe80::42:acff:fe11:2  prefixlen 64  scopeid 0x20<link>
            ether 02:42:ac:11:00:02  txqueuelen 0  (Ethernet)
            RX packets 7115  bytes 10516479 (10.0 MiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 3546  bytes 236182 (230.6 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 0  (Local Loopback)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    [root@13fe7a3f05cc /]# ping 192.168.32.101
    PING 192.168.32.101 (192.168.32.101) 56(84) bytes of data.
    64 bytes from 192.168.32.101: icmp_seq=1 ttl=63 time=3.00 ms
    64 bytes from 192.168.32.101: icmp_seq=2 ttl=63 time=0.359 ms
    
    
    
    保存更改的镜像:
    
    docker:/root# docker commit -m "centos_with_nettools_and_wget" -a "scan" 13fe7a3f05cc  centos_with_net:scan
    92b2e7f857ae6b84c6b2484ece2ad7e3f4e35137a2210a0e5944906099c12e67
    docker:/root# docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
    centos_with_net     scan                92b2e7f857ae        8 seconds ago       269.5 MB
    januswel/centos     latest              088820de4929        12 days ago         198.3 MB
    linux123            xxx123              088820de4929        12 days ago         198.3 MB
    linux123            jj                  088820de4929        12 days ago         198.3 MB
    linux123            latest              088820de4929        12 days ago         198.3 MB
    
    

  • 相关阅读:
    hdu 1181 (搜索BFS,深搜DFS,并查集)
    [置顶] ZSTACK之OSAL_Nv非易失性存储解读上
    Android中利用Fragment显示为两屏
    WCF也可以做聊天程序
    Myeclipse 连接MSSqlServer
    Mysql和Oracle的卸载
    第 5堂作业
    hdu 3421 Max Sum II
    【求助】一个菜鸟java作业,帮忙看一下错在哪儿,题目是判断回文数
    netcat使用
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6200317.html
Copyright © 2011-2022 走看看