zoukankan      html  css  js  c++  java
  • docker导入本地镜像

    -rw-r--r--  1 root root 98954220 Mar 17 17:02 centos-6-x86.tar.gz
    
    利用下载的包 创建镜像:
    
    
    cat centos-6-x86.tar.gz | docker import - centos-6-x86-64(名字自己定义)
    
    
    
    把一个现有的镜像,导出成文件:
    
    docker save -o centos_with_net.tar  IMAGE ID:
    
    docker:/root# docker  images
    REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
    centos_6.5_net      scan                9e2de3fc0748        About an hour ago   398.6 MB
    centos_with_net     scan                92b2e7f857ae        2 hours ago         269.5 MB
    januswel/centos     latest              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
    linux123            xxx123              088820de4929        12 days ago         198.3 MB
    centos              latest              bb3d629a7cbc        12 days ago         196.6 MB
    blalor/centos       latest              f01c1b138488        21 months ago       322.4 MB
    docker:/root# docker save -o centos_with_net.tar 92b2e7f857ae
    docker:/root# ls -ltr
    total 377296
    -rw-r--r--. 1 root root      7572 Jan 15  2015 install.log.syslog
    -rw-r--r--. 1 root root     27312 Jan 15  2015 install.log
    -rw-------. 1 root root      1342 Jan 15  2015 anaconda-ks.cfg
    -rw-r--r--  1 root root 277186048 Mar 17 17:07 centos_with_net.tar
    -rw-r--r--  1 root root 109115444 Mar 17 17:07 centos-6-x86.tar.gz
    
    
    导入镜像:
    
    docker load <centos_with_net.tar
    
    
    
    docker:/root# docker rmi 92b2e7f857ae
    Error response from daemon: Conflict, cannot delete 92b2e7f857ae because the running container cf141517fd59 
    
    is using it, stop it and use -f to force
    Error: failed to remove images: [92b2e7f857ae]
    
    docker 停止容器:
    
    
    docker:/root# docker load <centos_with_net.tar
    docker:/root# docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
    centos_6.5_net      scan                9e2de3fc0748        About an hour ago   398.6 MB
    <none>              <none>              92b2e7f857ae        2 hours ago         269.5 MB
    januswel/centos     latest              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
    linux123            xxx123              088820de4929        12 days ago         198.3 MB
    centos              latest              bb3d629a7cbc        12 days ago         196.6 MB
    blalor/centos       latest              f01c1b138488        21 months ago       322.4 MB
    
    倒回之后没有名字:
    
    docker:/root# docker tag 92b2e7f857ae centos_with_net:czcb
    docker:/root# docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
    centos_6.5_net      scan                9e2de3fc0748        About an hour ago   398.6 MB
    centos_with_net     czcb                92b2e7f857ae        2 hours ago         269.5 MB
    linux123            jj                  088820de4929        12 days ago         198.3 MB
    linux123            latest              088820de4929        12 days ago         198.3 MB
    linux123            xxx123              088820de4929        12 days ago         198.3 MB
    januswel/centos     latest              088820de4929        12 days ago         198.3 MB
    centos              latest              bb3d629a7cbc        12 days ago         196.6 MB
    blalor/centos       latest              f01c1b138488        21 months ago       322.4 MB
    
    
    
    
    
    

  • 相关阅读:
    9011,9012,9013,9014,8050,8550三极管的区别
    XP制动关机CMD命令
    搭建系统框架发现的三个Web.Config问题
    监听公众号返回按钮,直接退出到公众号页面
    微信公众号h5页面自定义分享
    博客园页面设置
    js 中加减乘除 比较精确的算法,js本身有些运算会出错,这里给出较精确的算法
    HTML属性
    HTML属性
    处理ajax数据;数据渲染(细节)
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350951.html
Copyright © 2011-2022 走看看