Cannot connect to the Docker daemon at tcp://0.0.0.0:2375. Is the docker daemon running?

当安装完Docker,运行时遇到此问题是因为docker service没有运行。
执行:service docker start 即可。

然后遇到下列问题:

Job for docker.service failed. See "systemctl status docker.service" and "journalctl -xe" for details.

首先按照提示执行:systemctl status docker.service
于是出现下面的信息

docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: e
   Active: failed (Result: start-limit-hit) since Fri 2018-11-30 14:16:46 CST; 5
     Docs: https://docs.docker.com
  Process: 4441 ExecStart=/usr/bin/dockerd -H unix:///var/run/docker.sock -H tcp
 Main PID: 4441 (code=exited, status=1/FAILURE)
    Tasks: 0
   Memory: 728.0K
      CPU: 55ms
   CGroup: /system.slice/docker.service

Nov 30 14:16:46 ubuntu dockerd[4441]: time="2018-11-30T14:16:46.029933210+08:00"
Nov 30 14:16:46 ubuntu dockerd[4441]: time="2018-11-30T14:16:46.030970178+08:00"
Nov 30 14:16:46 ubuntu dockerd[4441]: Error starting daemon: error initializing 
Nov 30 14:16:46 ubuntu systemd[1]: docker.service: Main process exited, code=exi
Nov 30 14:16:46 ubuntu systemd[1]: Failed to start Docker Application Container 
Nov 30 14:16:46 ubuntu systemd[1]: docker.service: Unit entered failed state.
Nov 30 14:16:46 ubuntu systemd[1]: docker.service: Failed with result 'exit-code
Nov 30 14:16:46 ubuntu systemd[1]: docker.service: Start request repeated too qu
Nov 30 14:16:46 ubuntu systemd[1]: Failed to start Docker Application Container 
Nov 30 14:16:46 ubuntu systemd[1]: docker.service: Failed with result 'start-lim


此时你需要做的是:
1.curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://*******.m.daocloud.io
2.修改/etc/docker/daemon.json 中的数据。此时会变成{“registry-mirrors”: [“http://****.m.daocloud.io”],}
将期修改为正确的json格式即可。
3.service docker start
就可以解决问题了

你可能感兴趣的:(Docker&K8s)