docker error creating overlay mount

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker error creating overlay mount相关的知识,希望对你有一定的参考价值。

最近在centos7.4使用docker运行镜像,出现下面的错误:

/var/lib/docker/overlay2/65f3c109fb903539820f84856d2725af784f2f03f95b1f0214e34184e4d61ff7-init/merged: invalid argument.

以下为Jenkins打包docker镜像出现的报错

error creating overlay mount to /var/lib/docker/overlay2/0312d0af799695a1b1640ea5390d96bae9890055a2d518609f144f97660b52a2-init/merged: no such file or directory

or

oci runtime error: container_linux.go:247: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory" 

or

[91mcontainer_linux.go:247: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"
oci runtime error: container_linux.go:247: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"

找到一个解决方法
停止docker服务

systemctl stop docker

清理镜像

rm -rf /var/lib/docker

修改存储类型
把空的DOCKER_STORAGE_OPTIONS参数改为overlay:

vi /etc/sysconfig/docker-storage
DOCKER_STORAGE_OPTIONS="--storage-driver overlay"

禁用selinux

vi /etc/sysconfig/docker
OPTIONS=‘--selinux-enabled --log-driver=journald --signature-verification=false‘
去掉 --selinux-enabled

启动docker

systemctl start docker

我的问题得以解决

以上是关于docker error creating overlay mount的主要内容,如果未能解决你的问题,请参考以下文章

docker: Error response from daemon: OCI runtime create failed 解决办法

docker容器启动报错:Error response from daemon: error creating overlay mount to /var/lib/docker/overlay2/dd

解决 error creating overlay mount to /var/lib/docker/overlay2

解决 error creating overlay mount to /var/lib/docker/overlay2

Error response from daemon: error creating overlay mount to /var/lib/docker/overlay2

解决docker启动错误 error creating overlay mount to /var/lib/docker/overlay2