Docker 容器启动报错的解决方法

发布时间:2023-12-01 19:00

环境:

  • Docker : 20.10.7
  • 系统:centos 7.9.2009
  • Docker安装方式:rpm包安装

错误信息

Docker服务没有任何问题,但是当容器启动时报如下错误:

docker: Error response from daemon: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/containerd/io.containerd.runtime.v2.task/moby/40b48d6f9ea6c0bbcbaa9413adb1914b41e4750465125742203b5d2cb72d3c06/log.json: no such file or directory): runc did not terminate successfully: unknown.
ERRO[0000] error waiting for container: context canceled

仔细看上边的报错,有一句runc did not terminate successfully: unknown.,猜测是runc导致的
运行runc:

$ runc
runc: error while loading shared libraries: libseccomp.so.2: cannot open shared object
file: No such file or directory

问题解决

通过上边执行runc命令发现少libseccomp.so.2动态库。应该是系统没安装libseccomp库。
安装libseccomp-2.3.1-4.el7.x86_64.rpm (直接搜索可以找到下载地址)

$ rpm -ivh libseccomp-2.3.1-4.el7.x86_64.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:libseccomp-2.3.1-4.el7           ################################# [100%]

再次启动容器成功!

ItVuer - 免责声明 - 关于我们 - 联系我们

本网站信息来源于互联网,如有侵权请联系:561261067@qq.com

桂ICP备16001015号