91

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

 5 years ago
source link: http://colobu.com/2018/06/28/Error-response-from-daemon-error-creating-overlay-mount-to-var-lib-docker-overlay2/?amp%3Butm_medium=referral
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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

/usr/bin/docker-current: Error response from daemon: error creating overlay mount to /var/lib/docker/overlay2/65f3c109fb903539820f84856d2725af784f2f03f95b1f0214e34184e4d61ff7-init/merged: invalid argument.
See '/usr/bin/docker-current run --help'.

在网上搜索一番后,一个可行的方案如下(改变storage driver类型, 禁用selinux):

  1. 停止docker服务
systemctl stop docker
  1. 清理镜像
rm -rf /var/lib/docker
  1. 修改存储类型
vi /etc/sysconfig/docker-storage

把空的DOCKER_STORAGE_OPTIONS参数改为overlay:

DOCKER_STORAGE_OPTIONS="--storage-driver overlay"
  1. 禁用selinux
vi /etc/sysconfig/docker

去掉option的 --selinux-enabled

  1. 启动docker应该就可以了
systemctl start docker

方案抄自 Ysssssssssssssss的博客 和 redis的讨论: error creating overlay mount to .../merged: invalid argument. , 基本可以确定是启用selinux导致的。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK