docker镜像保存到本地/加载镜像到docker

docker镜像保存到本地

[root@WzcWyt ~]# docker pull perl
Using default tag: latest
latest: Pulling from library/perl
0e29546d541c: Pull complete 
9b829c73b52b: Pull complete 
cb5b7ae36172: Pull complete 
6494e4811622: Pull complete 
6f9f74896dfa: Pull complete 
1a99cd2a1d0b: Pull complete 
83b15adf9bf3: Pull complete 
Digest: sha256:1ec7df9b6c70e31b05d937f929ddfe06a6a1966d98c09ae78ecfbb391a364739
Status: Downloaded newer image for perl:latest
docker.io/library/perl:latest

[root@WzcWyt ~]# docker images
REPOSITORY                   TAG        IMAGE ID       CREATED        SIZE
nginx                        latest     605c77e624dd   5 months ago   141MB
bitnami/mariadb              latest     292abccc8a66   5 months ago   333MB
perl                         latest     f9596eddf06f   5 months ago   890MB
jenkins/jenkins              latest     ebfdc38968c9   5 months ago   442MB
grafana/grafana              latest     9b957e098315   5 months ago   275MB
bitnami/testlink             latest     e0238ea7eb52   5 months ago   547MB
influxdb                     1.8        80a59ddecfe8   5 months ago   287MB
mysql                        latest     bbf6571db497   5 months ago   516MB
selenium/node-chrome-debug   3.141.59   345b8e9e3e5b   8 months ago   1.11GB
selenium/hub                 3.141.59   bdc613c470d8   8 months ago   283MB
hello-world                  latest     feb5d9fea6a5   8 months ago   13.3kB
jenkins                      latest     cd14cecfdb3a   3 years ago    696MB
[root@WzcWyt ~]# docker save f9596eddf06f > /root/wyt/perl.tar.gz

加载镜像到docker

[root@k8s-master01 ~]# docker load < perl.tar.gz    或   docker load -i perl.tar.gz
11936051f93b: Loading layer [==================================================>]  129.1MB/129.1MB
31892cc314cb: Loading layer [==================================================>]   11.3MB/11.3MB
8bf42db0de72: Loading layer [==================================================>]  19.31MB/19.31MB
26a504e63be4: Loading layer [==================================================>]  156.5MB/156.5MB
c3a0d593ed24: Loading layer [==================================================>]  537.7MB/537.7MB
ec36ab2f2b14: Loading layer [==================================================>]  3.584kB/3.584kB
5ddb296a672e: Loading layer [==================================================>]  57.87MB/57.87MB
Loaded image ID: sha256:f9596eddf06f9a24fc2ba0047cbec76cb8f3452ce35345a6e4df6c89e740beeb
[root@k8s-master01 ~]# docker images
REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE
<none>                               <none>              f9596eddf06f        5 months ago        890MB
nginx                                latest              04661cdce581        6 months ago        141MB
rethinkdb                            latest              2a54dcb95502        7 months ago        131MB
hello-world                          latest              feb5d9fea6a5        8 months ago        13.3kB
192.168.111.129:5000/demo            latest              40fc65df2cf9        14 months ago       660MB
demo                                 1.0-SNAPSHOT        40fc65df2cf9        14 months ago       660MB
registry                             latest              678dfa38fcfa        17 months ago       26.2MB
openstf/ambassador                   latest              938a816f078a        21 months ago       8.63MB
openstf/stf                          latest              91d0ab894aff        21 months ago       958MB
quay.io/coreos/flannel               v0.12.0-amd64       4e9f801d2217        2 years ago         52.8MB
k8s.gcr.io/kube-controller-manager   v1.15.1             d75082f1d121        2 years ago         159MB
k8s.gcr.io/kube-apiserver            v1.15.1             68c3eb07bfc3        2 years ago         207MB
k8s.gcr.io/kube-scheduler            v1.15.1             b0b3c4c404da        2 years ago         81.1MB
k8s.gcr.io/kube-proxy                v1.15.1             89a062da739d        2 years ago         82.4MB
k8s.gcr.io/coredns                   1.3.1               eb516548c180        3 years ago         40.3MB
k8s.gcr.io/etcd                      3.3.10              2c4adeb21b4f        3 years ago         258MB
sorccu/adb                           latest              7123ee61b746        4 years ago         30.5MB
k8s.gcr.io/pause                     3.1                 da86e6ba6ca1        4 years ago         742kB
java                                 8                   d23bdf5b1b1b        5 years ago         643MB
[root@k8s-master01 ~]# docker tag f9596eddf06f perl:latest
[root@k8s-master01 ~]# docker images
REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE
perl                                 latest              f9596eddf06f        5 months ago        890MB
nginx                                latest              04661cdce581        6 months ago        141MB
rethinkdb                            latest              2a54dcb95502        7 months ago        131MB
hello-world                          latest              feb5d9fea6a5        8 months ago        13.3kB
192.168.111.129:5000/demo            latest              40fc65df2cf9        14 months ago       660MB
demo                                 1.0-SNAPSHOT        40fc65df2cf9        14 months ago       660MB
registry                             latest              678dfa38fcfa        17 months ago       26.2MB
openstf/ambassador                   latest              938a816f078a        21 months ago       8.63MB
openstf/stf                          latest              91d0ab894aff        21 months ago       958MB
quay.io/coreos/flannel               v0.12.0-amd64       4e9f801d2217        2 years ago         52.8MB
k8s.gcr.io/kube-controller-manager   v1.15.1             d75082f1d121        2 years ago         159MB
k8s.gcr.io/kube-proxy                v1.15.1             89a062da739d        2 years ago         82.4MB
k8s.gcr.io/kube-scheduler            v1.15.1             b0b3c4c404da        2 years ago         81.1MB
k8s.gcr.io/kube-apiserver            v1.15.1             68c3eb07bfc3        2 years ago         207MB
k8s.gcr.io/coredns                   1.3.1               eb516548c180        3 years ago         40.3MB
k8s.gcr.io/etcd                      3.3.10              2c4adeb21b4f        3 years ago         258MB
sorccu/adb                           latest              7123ee61b746        4 years ago         30.5MB
k8s.gcr.io/pause                     3.1                 da86e6ba6ca1        4 years ago         742kB
java                                 8                   d23bdf5b1b1b        5 years ago         643MB

[root@k8s-master01 ingress]# scp /root/perl.tar.gz root@k8s-node01:/root/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值