web123456

Solve the problem that docker cannot start

Due to problems with downloading jenkins TLS handshark timeout, a method from the Internet was used:

$ echo "DOCKER_OPTS=\"\$DOCKER_OPTS --registry-mirror=\"" | sudo tee -a /etc/default/docker

Causes docker to start

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

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

I have checked many methods online, but they are not correct. Well, I can only compare the docker configuration on the server that can be used to see if there is any problem. Finally, the docker file in /etc/default/ needs to be commented out the last line in the file.

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

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

# The recommended alternative is "/etc/docker/", as described in:
#   /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:
#   /v1.11/engine/admin/systemd/#custom-docker-daemon-options
#DOCKER_OPTS="$DOCKER_OPTS --registry-mirror="

Then restart sudo service docker restart
It's finally OK! ! Your uncle