解决docker无法启动的问题

由于下载jenkins出现问题TLS handshark timeout,用了网上的一个方法:

$ echo "DOCKER_OPTS=\"\$DOCKER_OPTS --registry-mirror=http://f2d6cb40.m.daocloud.io\"" | sudo tee -a /etc/default/docker

导致docker无法启动

sudo service docker restart
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
root@zhangyuan7-Lenovo-XiaoXin-700-15ISK:/etc/docker# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since 四 2018-04-26 14:23:53 CST; 1min 23s ago
     Docs: https://docs.docker.com
  Process: 5210 ExecStart=/usr/bin/dockerd -H fd:// $DOCKER_OPTS (code=exited, status=1/FAILURE)
 Main PID: 5210 (code=exited, status=1/FAILURE)

426 14:23:53 zhangyuan7-Lenovo-XiaoXin-700-15ISK dockerd[5210]:       --tlskey string                         Path to TLS key file (default "/root/.docker/key.pem")
426 14:23:53 zhangyuan7-Lenovo-XiaoXin-700-15ISK dockerd[5210]:       --tlsverify                             Use TLS and verify the remote
426 14:23:53 zhangyuan7-Lenovo-XiaoXin-700-15ISK dockerd[5210]:       --userland-proxy                        Use userland proxy for loopback traffic (default true)
426 14:23:53 zhangyuan7-Lenovo-XiaoXin-700-15ISK dockerd[5210]:       --userland-proxy-path string            Path to the userland proxy binary
426 14:23:53 zhangyuan7-Lenovo-XiaoXin-700-15ISK dockerd[5210]:       --userns-remap string                   User/Group setting for user namespaces
426 14:23:53 zhangyuan7-Lenovo-XiaoXin-700-15ISK systemd[1]: Failed to start Docker Application Container Engine.
426 14:23:53 zhangyuan7-Lenovo-XiaoXin-700-15ISK dockerd[5210]:   -v, --version                               Print version information and quit
426 14:23:53 zhangyuan7-Lenovo-XiaoXin-700-15ISK dockerd[5210]: Run 'dockerd COMMAND --help' for more information on a command.
426 14:23:53 zhangyuan7-Lenovo-XiaoXin-700-15ISK systemd[1]: docker.service: Unit entered failed state.
426 14:23:53 zhangyuan7-Lenovo-XiaoXin-700-15ISK systemd[1]: docker.service: Failed with result 'exit-code'.

查阅了网上好多方法,都不对症,好吧,只有对比能用的服务器上面的docker配置看看有什么问题,终于在/etc/default/中的docker文件,需要把文件中的最后一行注释掉

# Here in Debian, this file is sourced by:
#   - /etc/init.d/docker (sysvinit)
#   - /etc/init/docker (upstart)
#   - systemd's docker.service

# Use of this file for configuring your Docker daemon is discouraged.

# The recommended alternative is "/etc/docker/daemon.json", as described in:
#   https://docs.docker.com/v1.11/engine/reference/commandline/daemon/#daemon-configuration-file

# If that does not suit your needs, try a systemd drop-in file, as described in:
#   https://docs.docker.com/v1.11/engine/admin/systemd/#custom-docker-daemon-options
#DOCKER_OPTS="$DOCKER_OPTS --registry-mirror=http://f2d6cb40.m.daocloud.io"

然后重启 sudo service docker restart
终于可以了!!你大爷的

你可能感兴趣的:(linux,docker)