19.1.3  镜像加速

更新于 2026年10月13日 版权声明
19.1.3 镜像加速

在使用Docker下载镜像并且运行容器之前,还有一项配置是必不可少的,即为Docker的镜像下载配置加速器。这里使用DaoCloud的加速器配置方法,在服务器执行如下命令: $curl-sSL https://get.daocloud.io/daotools/set_mirror.sh│sh-s http://5b55f8e6.m.daocloud.io 执行命令后,会得到如下输出。

$docker version>=1.12

{"registry-mirrors":["http://5b55f8e6.m.daocloud.io"],}

Success.

You need to restart docker to take effect:sudo systemctl restart docker

上面生成的地址中,末尾多了一个逗号,所以需要修改/etc/docker/目录下的daemon.json文件,改为(https://www.daowen.com)

{"registry-mirrors":["http://5b55f8e6.m.daocloud.io"]}

然后执行如下命令,重启服务。

$systemctl daemon-reload

$systemctl restart docker

✍AI写作