Mysql

关注公众号 jb51net

关闭
首页 > 数据库 > Mysql > 解决docker无法启动的问题

如何解决docker无法启动的问题

作者:早起吃虫虫

这篇文章主要介绍了如何解决docker无法启动的问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教

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

终于可以了!!

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。

您可能感兴趣的文章:
阅读全文