目录
1. docker save
2. docker load
3. Tip: Linux scp 命令
某些情况下
你可能需要离线安装镜像
docker save、docker load
可以帮到你
1. docker save
使用 docker save 将指定镜像保存成 tar 归档文件。
Save one or more images to a tar archive (streamed to STDOUT by default)
docker save busybox > busybox.tar
docker save --output busybox.tar busybox
docker save -o fedora-all.tar fedora
docker save -o ubuntu.tar ubuntu:lucid ubuntu:saucy
2. docker load
使用 docker load 导入 docker save 命令导出的镜像归档文件。
Load an image from a tar archive or STDIN
docker load < busybox.tar.gz
docker load --input fedora.tar
3. Tip: Linux scp 命令
Linux scp 命令用于 Linux 之间复制文件和目录。scp是 secure copy的缩写, scp是linux系统下基于ssh登陆进行安全的远程文件拷贝命令。
SCP (secure copy) is a command-line utility that allows you to securely copy files and directories between two locations.
With scp, you can copy a file or directory:
语法:
scp [OPTION] [user@]SRC_HOST:]file1 [user@]DEST_HOST:]file2
从本地复制到远程:
# 拷贝文件
scp /home/test/test.txt root@192.168.0.2:/home/test/
# 拷贝目录
scp -r /home/test/ root@192.168.0.2:/home/test/
从远程复制到本地:
# 拷贝文件
scp root@192.168.0.2:/home/test/ /home/test/test.txt
# 拷贝目录
scp -r root@192.168.0.2:/home/test/ v/home/test/
参考:
docker save: https://docs.docker.com/engine/reference/commandline/save/ docker load: https://docs.docker.com/engine/reference/commandline/load/
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有