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

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

CentOS 7.5 x64下

sudo yum install docker -y systemctl enable dockersystemctl 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/FAILUREFailed to start Docker Application Container Engine.

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

cat /etc/systemd/system/multi-user.target.wants/docker.service[Unit]Description=Docker Application Container EngineDocumentation=http://docs.docker.comAfter=network.targetWants=docker-storage-setup.serviceRequires=docker-cleanup.timer[Service]Type=notifyNotifyAccess=mainEnvironmentFile=-/run/containers/registries.confEnvironmentFile=-/etc/sysconfig/dockerEnvironmentFile=-/etc/sysconfig/docker-storageEnvironmentFile=-/etc/sysconfig/docker-networkEnvironment=GOTRACEBACK=crashEnvironment=DOCKER_HTTP_HOST_COMPAT=1Environment=PATH=/usr/libexec/docker:/usr/bin:/usr/sbinExecStart=/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 $REGISTRIESExecReload=/bin/kill -s HUP $MAINPIDLimitNOFILE=1048576LimitNPROC=1048576LimitCORE=infinityTimeoutStartSec=0Restart=on-abnormalKillMode=process[Install]WantedBy=multi-user.targetcat /etc/sysconfig/docker-storageDOCKER_STORAGE_OPTIONS="--storage-driver overlay2 "

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

dockerdINFO[0000] libcontainerd: new containerd process, pid: 29626 WARN[0000] containerd: low RLIMIT_NOFILE changing to max  current=1024 max=4096INFO[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.1INFO[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 学习.

免责声明:本网信息来自于互联网,目的在于传递更多信息,并不代表本网赞同其观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,并请自行核实相关内容。本站不承担此类作品侵权行为的直接责任及连带责任。如若本网有任何内容侵犯您的权益,请及时联系我们,本站将会在24小时内处理完毕。
相关文章
返回顶部