Docker迁移镜像

Linux 下,不要使用 root用户管理 Docker

迁移镜像

保存镜像到本地

保存镜像命令

1
docker save -o 本地文件名  要保存的镜像

查看镜像

1
docker images

保存一个镜像

1
docker save -o redis.tar redis

导入镜像

1
2
3
docker load --input 文件
#或者
docker load < 文件名

附录

daemon.json

  • windows 下的地址 C:\Users\${USER}\.docker\daemon.json
  • linux 下的地址 /etc/docker/daemon.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"registry-mirrors": [
"https://kfwkfulq.mirror.aliyuncs.com",
"https://2lqq34jg.mirror.aliyuncs.com",
"https://pee6w651.mirror.aliyuncs.com",
"https://docker.mirrors.ustc.edu.cn",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com"
],
"dns": ["8.8.8.8", "8.8.4.4"],
"insecure-registries": [],
"debug": false,
"experimental": false,
"features": {
"buildkit": true
},
"builder": {
"gc": {
"enabled": true,
"defaultKeepStorage": "20GB"
}
}
}

本文地址: https://github.com/maxzhao-it/blog/post/34094/