centos上配置加速器命令:
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://da88f05f.m.daocloud.io
报错:
Job for docker.service failed because the control process exited with error code. See “systemctl status docker.service” and “journalctl -xe” for details.
输入systemctl status docker.service后,发现:
unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character ‘}’ looking for beginning of… key string
打开/etc/docker/daemon.json文件:
发现内容为:
{“registry-mirrors”: [“http://da88f05f.m.daocloud.io”] , }
即末尾多了一个逗号,将其删除后保存,再重启docker即可:
systemctl start docker
为什么会多一个逗号?
daocloud的配置信息是写在/etc/docker/daemon.json文件中的,而云主机的daemon.json文件原来是空的,但是daocloud配置脚本会在该文件写入:{“registry-mirrors”: [“http://da88f05f.m.daocloud.io”] , } 多写了一个逗号,导致json文件格式不正确,出错。