创建容器失败报错
[root@izbp152ke14timzud0du15z compose]# docker run -d ubuntu:demo03ea601ae9ac8132f41ddfd9113d55492223eb12a7fe57851689306c829ecce0 docker: Error response from daemon: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/containerd/io.containerd.runtime.v2.task/moby/03ea601ae9ac8132f41ddfd9113d55492223eb12a7fe57851689306c829ecce0/log.json: no such file or directory): runc did not terminate successfully: unknown.
查看docker服务状态
[root@izbp152ke14timzud0du15z compose]# systemctl status docker● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled) Active: active (running) since Tue 2022-04-1907:53:17 CST; 14min ago Docs: https://docs.docker.com Main PID: 9411 (dockerd) Tasks: 139 Memory: 262.1M CGroup: /system.slice/docker.service └─9411 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock Apr 1908:07:18 izbp152ke14timzud0du15z dockerd[9411]: time="2022-04-19T08:07:18.719969980+08:00"level=warning msg="failed to retrieve runc version: exit status 127"Apr 1908:07:18 izbp152ke14timzud0du15z dockerd[9411]: time="2022-04-19T08:07:18.724307409+08:00"level=warning msg="failed to retrieve runc version: exit status 127"Apr 1908:07:18 izbp152ke14timzud0du15z dockerd[9411]: time="2022-04-19T08:07:18.729515514+08:00"level=warning msg="failed to retrieve runc version: exit status 127"Apr 1908:07:18 izbp152ke14timzud0du15z dockerd[9411]: time="2022-04-19T08:07:18.732048784+08:00"level=warning msg="failed to retrieve runc version: exit status 127"Apr 1908:07:18 izbp152ke14timzud0du15z dockerd[9411]: time="2022-04-19T08:07:18.737637287+08:00"level=warning msg="failed to retrieve runc version: exit status 127"
报错日志:
level=warning msg="failed to retrieve runc version: exit status 127"
查看docker version信息, 也没看到runc
[root@izbp152ke14timzud0du15z compose]# docker versionClient: Docker Engine - Community Version: 20.10.12 API version: 1.41 Go version: go1.16.12 Git commit: e91ed57 Built: Mon Dec 1311:45:41 2021 OS/Arch: linux/amd64 Context: default Experimental: trueServer: Docker Engine - Community Engine: Version: 20.10.12 API version: 1.41 (minimum version 1.12) Go version: go1.16.12 Git commit: 459d0df Built: Mon Dec 1311:44:05 2021 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.4.12 GitCommit: 7b11cfaabd73bb80907dd23182b9347b4245eb5d docker-init: Version: 0.19.0 GitCommit: de40ad0
我为什么会碰到此问题?
我通过whereis 查找runc,发现两个位置存在此文件,但是通过md5sum比对,发现两个文件的md5sum值不一样
[root@izbp152ke14timzud0du15z ~]# whereis runcrunc: /usr/bin/runc /usr/local/sbin/runc [root@izbp152ke14timzud0du15z ~]# md5sum /usr/bin/runc3c363f2ba5a276132d55a42f8998d883 /usr/bin/runc [root@izbp152ke14timzud0du15z ~]# md5sum /usr/local/sbin/runc5eff008a1fb5afe8c2deca6a62e92d16 /usr/local/sbin/runc
把能用的runc文件覆盖掉不能用的runc文件,能用的runc执行有输出信息
# runc --versionrunc version 1.0.2 commit: v1.0.2-0-g52b36a2 spec: 1.0.2-dev go: go1.16.10 libseccomp: 2.3.1
https://github.com/opencontainers/runc/releases runc下载地址
正常了
[root@izbp152ke14timzud0du15z sbin]# docker versionClient: Docker Engine - Community Version: 20.10.12 API version: 1.41 Go version: go1.16.12 Git commit: e91ed57 Built: Mon Dec 1311:45:41 2021 OS/Arch: linux/amd64 Context: default Experimental: trueServer: Docker Engine - Community Engine: Version: 20.10.14 API version: 1.41 (minimum version 1.12) Go version: go1.16.15 Git commit: 87a90dc Built: Thu Mar 2401:48:24 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.6.1 GitCommit: 10f428dac7cec44c864e1b830a4623af27a9fc70 runc: Version: 1.0.2 GitCommit: v1.0.2-0-g52b36a2 docker-init: Version: 0.19.0 GitCommit: de40ad0