docker无网络环境安装镜像

时间:2021-03-03 12:18:43   收藏:0   阅读:0

docker无网络环境安装镜像

1、从其它有网络环境的机器导出镜像

#查看镜像
docker images
liyc@liyc-VirtualBox:~ $ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
minio/minio         latest              6c897135cbab        6 weeks ago         185MB
nginx               latest              f6d0b4767a6c        7 weeks ago         133MB
redis               latest              50541622f4f1        7 months ago        104MB
mysql               latest              6e447ce4863d        7 months ago        544MB
rabbitmq            3.7.7-management    2888deb59dfc        2 years ago         149MB
#导出nginx镜像
docker save -o nginx.tar nginx

2、导入镜像

root@localhost home]# docker load -i nginx.tar 
cb42413394c4: Loading layer [==================================================>]  72.51MB/72.51MB
1c91bf69a08b: Loading layer [==================================================>]   64.6MB/64.6MB
56bc37de0858: Loading layer [==================================================>]  3.072kB/3.072kB
3e5288f7a70f: Loading layer [==================================================>]  4.096kB/4.096kB
85fcec7ef3ef: Loading layer [==================================================>]  3.584kB/3.584kB
Loaded image: nginx:latest

note:如果需要导出容器为镜像则需要使用export/import命令

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!