docker镜像加速遇见的一个问题

今天运行docker发现了一个问题,运行docker images会报

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

但是运行docker -v是正常的

运行 systemctl start docker报

Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

最后查了一下,发现如果docker 出了问题,可以根据提示使用linux命令journalctl -xe查看,这个命令是系统的服务出错以后会有日志记录的地方,或者你专注于某个服务的查询的话,比如docker,可以使用 journalctl -u docker.service

通过这个查询到问题是:

unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character 's' looking for beginning of value

原来是我的daemon.json配置的有问题,按照阿里云给出的步骤应该只在这个文件里写

{ "registry-mirrors": ["https://给你的地址开头.mirror.aliyuncs.com"] }

但是我把linux的其他命令也写进去了。

通过这次解决问题,主要还是学到了查看系统日志去解决服务出问题的情况。

posted @ 2019-08-12 20:24  洛晨随风  阅读(1306)  评论(1编辑  收藏  举报