请教一个 docker load 的问题(ERRO[0000] error waiting for container: context canceled)

239 天前
 leegoo

事情是这样的,我有两台服务器,我在 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

613 次点击
所在节点    Docker
2 条回复
nagisaushio
239 天前
虽然我也不知道为什么,但是提示一下真正的报错是上面那行 permission denied
leegoo
238 天前
@nagisaushio 嗯,但是我确实是用 root 用户执行的。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1023726

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX