今天在CentOS上安装了最新的Docker-ce(最新会安装到20.10版本),安装完成后,发现无法启动任何容器container,就算是简单的官方helloworld都不行:
docker run hello-world
错误日志如下:
Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/var/lib/docker/containers/e80097ec1c7a8df0abdb69feb95a60941a3f485862e7b99903d661d8c9d4ba22/resolv.conf" to rootfs at "/etc/resolv.conf": possibly malicious path detected -- refusing to operate on /etc/resolv.conf: unknown Error: failed to start containers: e80097ec1c7a
解决办法
摸索了一阵子,排查了文件权限问题,也查阅网上解决办法,有人建议将docker-ce降级,解决了这个问题。
降级到docker-ce 19.03版本即可,操作命令如下:
sudo systemctl stop docker sudo yum remove docker-ce docker-ce-cli containerd.io sudo yum install containerd.io-1.3.7-3.1.el7 sudo yum install docker-ce-19.03.4 docker-ce-cli-19.03.4 sudo systemctl start docker sudo systemctl enable docker
文章评论