解决 docker 报错: Error starting daemon: error initializing graphdriver: backing file system is unsuppor

Posted ayanmw

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决 docker 报错: Error starting daemon: error initializing graphdriver: backing file system is unsuppor相关的知识,希望对你有一定的参考价值。

CentOS 7.5 x64下

sudo yum install docker -y 

systemctl enable docker

systemctl start docker

发现启动失败

journalctl -xe

查询获得报错


Jan 11 22:49:16 localhost.localdomain dockerd-current[29403]: time="2019-01-11T22:49:16.686305029+08:00" level=info msg="libcontainerd: new containerd process, pid: 29410"
Jan 11 22:49:17 localhost.localdomain dockerd-current[29403]: time="2019-01-11T22:49:17.696062387+08:00" level=error msg="‘overlay2‘ requires kernel 4.7 to use on btrfs"
Jan 11 22:49:17 localhost.localdomain dockerd-current[29403]: Error starting daemon: error initializing graphdriver: backing file system is unsupported for this graph driver


docker.service: main process exited, code=exited, status=1/FAILURE

Failed to start Docker Application Container Engine.

 

然后搜索了一番,暂时没找到。 然后就自己研究一下。

cat /etc/systemd/system/multi-user.target.wants/docker.service


[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=network.target
Wants=docker-storage-setup.service
Requires=docker-cleanup.timer

[Service]
Type=notify
NotifyAccess=main
EnvironmentFile=-/run/containers/registries.conf
EnvironmentFile=-/etc/sysconfig/docker
EnvironmentFile=-/etc/sysconfig/docker-storage
EnvironmentFile=-/etc/sysconfig/docker-network
Environment=GOTRACEBACK=crash
Environment=DOCKER_HTTP_HOST_COMPAT=1
Environment=PATH=/usr/libexec/docker:/usr/bin:/usr/sbin
ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
TimeoutStartSec=0
Restart=on-abnormal
KillMode=process

[Install]
WantedBy=multi-user.target

cat /etc/sysconfig/docker-storage

DOCKER_STORAGE_OPTIONS="--storage-driver overlay2 "

尝试执行dockerd 命令,结果运行成功,提示:

dockerd
INFO[0000] libcontainerd: new containerd process, pid: 29626 
WARN[0000] containerd: low RLIMIT_NOFILE changing to max  current=1024 max=4096
INFO[0001] [graphdriver] using prior storage driver: btrfs 
INFO[0001] Graph migration to content-addressability took 0.00 seconds 
INFO[0001] Loading containers: start.                   
INFO[0001] Firewalld running: false                     
INFO[0001] Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address 
INFO[0001] Loading containers: done.                    
WARN[0001] failed to retrieve docker-runc version: exec: "docker-runc": executable file not found in $PATH 
WARN[0001] failed to retrieve docker-init version       
INFO[0001] Daemon has completed initialization          
INFO[0001] Docker daemon                                 commit="07f3374/1.13.1" graphdriver=btrfs version=1.13.1
INFO[0001] API listen on /var/run/docker.sock           

发现了关键字:   graphdriver=btrfs 以及之前的报错有提示:  error msg="‘overlay2‘ requires kernel 4.7 to use on btrfs"

所以尝试修改 /etc/sysconfig/docker-storage 为:
DOCKER_STORAGE_OPTIONS="--storage-driver btrfs "

重新启动docker:

systemctl start docker

启动成功.问题解决!

下面开始 docker 学习.

 



以上是关于解决 docker 报错: Error starting daemon: error initializing graphdriver: backing file system is unsuppor的主要内容,如果未能解决你的问题,请参考以下文章

Docer容器客户端在启动的镜像的时候报错Error invoking remote method ‘docker-start-container‘: Error: (HTTP code 500

Docer容器客户端在启动的镜像的时候报错Error invoking remote method ‘docker-start-container‘: Error: (HTTP code 500

Docer容器客户端在启动的镜像的时候报错Error invoking remote method ‘docker-start-container‘: Error: (HTTP code 500(代码

报错 Error starting ApplicationContext 解决

解决 docker run 报错 oci runtime error

service docker start 报错 :Failed to start docker.se