启动docker时报如下错误:
[root@localhost docker]# systemctl restart docker.service
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
[root@localhost docker]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2018-07-15 01:54:20 PDT; 1min 45s ago
Docs: http://docs.docker.com
Process: 44951 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 (code=exited, status=1/FAILURE)
Main PID: 44951 (code=exited, status=1/FAILURE)
Jul 15 01:54:20 localhost.localdomain systemd[1]: Starting Docker Application Container Engine...
Jul 15 01:54:20 localhost.localdomain dockerd-current[44951]: unable to configure the Docker daemon w...rs
Jul 15 01:54:20 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, ...URE
Jul 15 01:54:20 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
Jul 15 01:54:20 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
Jul 15 01:54:20 localhost.localdomain systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
解决办法:
查看文件系统 /etc/docker/daemon.json 有没有这个文件,没有则创建一个,并在里面加入以下内容:
{
“storage-driver”:"devicemapper"
}
如果daemon.json文件包含格式不正确的JSON,那么Docker也无法启动。