事情是这样的,我有两台服务器,我在 A 服务器上面已经使用docker pull redis
,并且正常运行
我现在需要将 docker 里面的 redis 迁移到 B 服务器(B 服务器是内网环境)
所以我使用 docker save
和 docker load
命令,但是 docker load
提示
ERRO[0000] error waiting for container: context canceled
下面这是 A 服务器上的操作
[root@localhost tmp]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@localhost tmp]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
redis 6.0 5e50eed779b1 3 months ago 126MB
[root@localhost tmp]# docker save -o redis_6.0.tar redis:6.0
[root@localhost tmp]# sz redis_6.0.tar
rz
zmodem trl+C ȡ
正在传输 redis_6.0.tar...
100% 127713 KB 63856 KB/ 00:00:02 0
然后我把 redis_6.0.tar
传到 B 服务器 并且进行了docker load
操作
-rw-r--r-- 1 root root 130778112 Mar 14 2024 redis_6.0.tar
drwx------ 3 root root 60 Mar 14 00:43 systemd-private-1050e01145eb417f803614d08584fd12-chronyd.service-y10izh
drwx------ 3 root root 60 Mar 14 00:43 systemd-private-1050e01145eb417f803614d08584fd12-ModemManager.service-C5uss0
drwx------ 3 root root 60 Mar 14 00:43 systemd-private-1050e01145eb417f803614d08584fd12-rtkit-daemon.service-VTGvUy
drwx------ 3 root root 60 Mar 14 00:43 systemd-private-1050e01145eb417f803614d08584fd12-systemd-logind.service-H1vY1S
[root@localhost tmp]# sudo docker load -i redis_6.0.tar
ceb365432eec: Loading layer 77.83MB/77.83MB
6cbb7561e1b5: Loading layer 10.75kB/10.75kB
b8193dd07dc2: Loading layer 10.75kB/10.75kB
dbbba2a456e9: Loading layer 4.143MB/4.143MB
6045f5430ff2: Loading layer 48.75MB/48.75MB
92db3a851eaf: Loading layer 1.536kB/1.536kB
5f70bf18a086: Loading layer 1.024kB/1.024kB
12739a454b8b: Loading layer 4.096kB/4.096kB
Loaded image: redis:6.0
[root@localhost tmp]# docker run redis:6.0
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: container_linux.go:318: starting container process caused "permission denied": unknown.
ERRO[0000] error waiting for container: context canceled
这是我的服务器信息(两台服务器都是通过虚拟机使用同一个镜像安装的)
[root@localhost tmp]# uname -a
Linux localhost.localdomain 4.19.90-52.22.v2207.ky10.x86_64 #1 SMP Tue Mar 14 12:19:10 CST 2023 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost tmp]# docker info
Client:
Version: 25.0.0
Context: default
Debug Mode: false
Server:
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 1
Server Version: 25.0.0
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 71909c1814c544ac47ab91d2e8b84718e517bb99
runc version:
init version: de40ad0
Security Options:
seccomp
Profile: builtin
Kernel Version: 4.19.90-52.22.v2207.ky10.x86_64
Operating System: Kylin Linux Advanced Server V10 (Lance)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 6.504GiB
Name: localhost.localdomain
ID: 911eb204-1c0f-459d-8c37-b7e1af6e90a1
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
1
nagisaushio 239 天前 via Android
虽然我也不知道为什么,但是提示一下真正的报错是上面那行 permission denied
|
2
leegoo OP @nagisaushio 嗯,但是我确实是用 root 用户执行的。。。
|