1. 程式人生 > >docker error creating overlay mount

docker error creating overlay mount

led directory linux. conf 禁用selinux 清理 starting oci 存儲

最近在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