完美解决systemctl start docker.service启动容器报错

安装docker容器后,启动时报错如下:

[root@joinApp2 ~]# systemctl  start  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@joinApp2 ~]# 
[root@joinApp2 ~]# 
[root@joinApp2 ~]# 
[root@joinApp2 ~]# 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: start-limit) since Thu 2016-02-25 17:26:11 CST; 16s ago
     Docs: 
                      http://docs.docker.com Process: 16384 ExecStart=/usr/bin/docker daemon $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=1/FAILURE)
 Main PID: 16384 (code=exited, status=1/FAILURE)
Feb 25 17:26:10 joinApp2 systemd[1]: Failed to start Docker Application Container Engine.
Feb 25 17:26:10 joinApp2 systemd[1]: Unit docker.service entered failed state.
Feb 25 17:26:10 joinApp2 systemd[1]: docker.service failed.
Feb 25 17:26:11 joinApp2 systemd[1]: docker.service holdoff time over, scheduling restart.
Feb 25 17:26:11 joinApp2 systemd[1]: start request repeated too quickly for docker.service
Feb 25 17:26:11 joinApp2 systemd[1]: Failed to start Docker Application Container Engine.
Feb 25 17:26:11 joinApp2 systemd[1]: Unit docker.service entered failed state.
Feb 25 17:26:11 joinApp2 systemd[1]: docker.service failed.

解决方法:

在/etc/docker/目录下创建daemon.json,添加如下内容:

{
 "insecure-registries" : ["storage-shshukun:5050"],
"registry-mirrors": ["https://wwuqa7no.mirror.aliyuncs.com"],
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
            }
    }
}

再运行systemctl  start  docker.service命令进行重启即可。

你可能感兴趣的:(完美解决systemctl start docker.service启动容器报错)