372 字
2 分钟
Containerd task启动容器ctr: failed to create shim task: OCI runtime create failed
错误信息如下:
ctr: failed to create shim task: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/containerd/io.containerd.runtime.v2.task/i4t/nginx/log.json: no such file or directory): runc did not terminate successfully: exit status 127: unknown
我们执行的命令如下
[root@web01 ~]# ctr -n i4t c lsCONTAINER IMAGE RUNTIMEnginx docker.io/library/nginx:alpine io.containerd.runc.v2[root@web01 ~]# ctr -n i4t task start -d nginxctr: failed to create shim task: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/containerd/io.containerd.runtime.v2.task/i4t/nginx/log.json: no such file or directory): runc did not terminate successfully: exit status 127: unknown
原因是 runc 异常,需要重新安装依赖
解决办法:
这个是说缺少依赖包libseccomp
,需要注意的是centos7
中 yum 下载的版本是 2.3 的,版本不满足我们最新 containerd 的需求,需要下载 2.4 以上的
#卸载原来的[i4t@web01 ~]# rpm -qa | grep libseccomplibseccomp-devel-2.3.1-4.el7.x86_64libseccomp-2.3.1-4.el7.x86_64[i4t@web01 ~]# rpm -e libseccomp-devel-2.3.1-4.el7.x86_64 --nodeps[i4t@web01 ~]# rpm -e libseccomp-2.3.1-4.el7.x86_64 --nodeps#下载高于2.4以上的包[i4t@web01 ~]# wget http://rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/libseccomp-2.5.1-1.el8.x86_64.rpm#安装[i4t@web01 ~]# rpm -ivh libseccomp-2.5.1-1.el8.x86_64.rpmwarning: libseccomp-2.5.1-1.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEYPreparing... ################################# [100%]Updating / installing... 1:libseccomp-2.5.1-1.el8 ################################# [100%]#查看当前版本[root@web01 ~]# rpm -qa | grep libseccomplibseccomp-2.5.1-1.el8.x86_64
执行 runc
[root@web01 ~]# runcNAME: runc - Open Container Initiative runtimerunc is a command line client for running applications packaged according tothe Open Container Initiative (OCI) format and is a compliant implementation of theOpen Container Initiative specification.runc integrates well with existing process supervisors to provide a productioncontainer runtime environment for applications. It can be used with yourexisting process monitoring tools and the container will be spawned as adirect child of the process supervisor.Containers are configured using bundles. A bundle for a container is a directorythat includes a specification file named "config.json" and a root filesystem.The root filesystem contains the contents of the container.To start a new instance of a container:....
Containerd task启动容器ctr: failed to create shim task: OCI runtime create failed
https://catcat.blog/containerd-task-start-ctr-failed-to-create-shim-task-oci.html