遇到这样一个问题,Docker服务启动失败, 输入命令:systemctl status docker.service查看错误原因,如下:

    [root@localhost ~]# systemctl status docker.service
    ● docker.service - Docker Application Container Engine
       Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
       Active: failed (Result: exit-code) since 二 2018-04-24 20:53:27 CST; 3min 16s ago
         Docs: http://docs.docker.com
      Process: 18390 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 --seccomp-profile=/etc/docker/seccomp.json $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES (code=exited, status=1/FAILURE)
     Main PID: 18390 (code=exited, status=1/FAILURE)

    424 20:53:26 localhost.localdomain systemd[1]: Starting Docker Application Container Engine...
    424 20:53:26 localhost.localdomain dockerd-current[18390]: time="2018-04-24T20:53:26.275744964+08:00" level=warning msg="could not change group /var/run/docker.sock to doc...not found"
    424 20:53:26 localhost.localdomain dockerd-current[18390]: time="2018-04-24T20:53:26.284526092+08:00" level=info msg="libcontainerd: new containerd process, pid: 18395"
    424 20:53:27 localhost.localdomain dockerd-current[18390]: time="2018-04-24T20:53:27.320599559+08:00" level=error msg="'overlay' not found as a supported filesystem on thi...t loaded."
    424 20:53:27 localhost.localdomain dockerd-current[18390]: Error starting daemon: error initializing graphdriver: driver not supported
    424 20:53:27 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
    424 20:53:27 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
    424 20:53:27 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
    424 20:53:27 localhost.localdomain systemd[1]: docker.service failed.
    Hint: Some lines were ellipsized, use -l to show in full.

在网上查了很多资料,无果。
后来从宋净超的handbook上找到了解决办法,我们需要修改docke配置文件/usr/lib/systemd/system/docker.service:

ExecStart=/usr/bin/dockerd --insecure-registry=sz-pg-oam-docker-hub-001.tendcloud.com -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock

修改好后执行以下命令即可:
systemctl daemon-reload
systemctl restart docker

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐