标签:let bash tar 本地 image names stat centos dock
1
2
3
4
5
6
7
|
bash -3.2 # docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 96d50d4ae5e4 centos "/bin/bash" 2 hours ago Exited (0) 2 hours ago desperate_hopper bash -3.2 # docker start 96d50d4ae5e4 #启动容器 bash -3.2 # docker exec -it 96d50d4ae5e4 /bin/bash #进入容器 96d50d4ae5e4 # yum -y install net-tools wget vim 96d50d4ae5e4 # exit |
1
2
3
4
5
6
7
8
9
10
11
|
bash -3.2 # docker commit -m "centos_with_nettools_and_wget_vim" -a "90root" 96d50d4ae5e4 new_centos:01 b064581f65d5c5e21ae10568c274804a12ff59bce4e8c7c740274e3f432f938a ### -m: 改动信息 -a: 作者信息 96d50d4ae5e4: 这一串为容器ID new_centos:01 新镜像的名字 bash -3.2 # docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE new_centos 01 b064581f65d5 About a minute ago 279.3 MB 90root 90root 2a332da70fd1 2 weeks ago 196.7 MB centos latest 2a332da70fd1 2 weeks ago 196.7 MB |
openva
官网下载(https://openvz.org/Download/template/precreated)
1
2
3
4
|
bash -3.2 # cat centos-6-x86_64-minimal.tar.gz |docker import - centos-6-x86_minimal bash -3.2 # docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE centos-6-x86_minimal latest 4cc6c9327f19 16 seconds ago 326.3 MB |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
bash -3.2 # docker save -o new_centos.tar b064581f65d5 #导出 bash -3.2 # docker load --input new_centos.tar #导入 bash -3.2 # docker load < new_centos.tar #导入 ### 以上两种导入方法,二选一. ### 演示镜像导入 bash -3.2 # docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE centos-6-x86_minimal latest 4cc6c9327f19 12 minutes ago 326.3 MB new_centos 01 b064581f65d5 42 minutes ago 279.3 MB bash -3.2 # docker rmi b064581f65d5 Untagged: new_centos:01 Deleted: b064581f65d5c5e21ae10568c274804a12ff59bce4e8c7c740274e3f432f938a bash -3.2 # docker load < new_centos.tar bash -3.2 # docker images <none> <none> b064581f65d5 9 months ago 0 B bash -3.2 # docker tag b064581f65d5 new_centos:01 #改名 |
1
|
bash -3.2 # docker push image_name |
标签:let bash tar 本地 image names stat centos dock
原文地址:http://www.cnblogs.com/90root/p/6140614.html