最近在centos7.4使用docker運行鏡像,出現下面的錯誤:linux
/var/lib/docker/overlay2/65f3c109fb903539820f84856d2725af784f2f03f95b1f0214e34184e4d61ff7-init/merged: invalid argument.
如下爲Jenkins打包docker鏡像出現的報錯docker
error creating overlay mount to /var/lib/docker/overlay2/0312d0af799695a1b1640ea5390d96bae9890055a2d518609f144f97660b52a2-init/merged: no such file or directory
orcentos
oci runtime error: container_linux.go:247: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"
oride
[91m[0m[91mcontainer_linux.go:247: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory" [0moci runtime error: container_linux.go:247: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"
找到一個解決方法
中止docker服務centos7
systemctl stop docker
清理鏡像code
rm -rf /var/lib/docker
修改存儲類型 (可選擇不修改存儲類型)。ci
建議瞭解一下 overlay overlay2 兩種驅動的區別
overlay 共享數據方式是經過硬鏈接
overlay2 是經過每層的 lower文件 就是overlay2目錄下L目錄軟鏈接it
把空的DOCKER_STORAGE_OPTIONS參數改成overlay:io
vi /etc/sysconfig/docker-storage DOCKER_STORAGE_OPTIONS="--storage-driver overlay"
禁用selinuxclass
vi /etc/sysconfig/docker OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false' 去掉 --selinux-enabled
啓動docker
systemctl start docker
個人問題得以解決