Docker 国内镜像加速
使用docker中的一重大问题就是国外镜像很不稳定,而且国内经常连不上,所以就有了国内专有的镜像加速。
修改Docker配置
在 /etc/docker/daemon.json 文件并添加上 registry-mirrors 键值。如果此文件不存在,需要自己手动创建一下,内容如下:
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
Docker重启
systemctl restart docker.service
Docker pull 测试
我使用下载镜像mysql为示例,速度确实变得很快了
[root@localhost mysql]# docker pull mysql
Using default tag: latest
latest: Pulling from library/mysql
2a72cbf407d6: Pull complete
38680a9b47a8: Pull complete
4c732aa0eb1b: Pull complete
c5317a34eddd: Pull complete
f92be680366c: Pull complete
e8ecd8bec5ab: Pull complete
2a650284a6a8: Pull complete
f3baca4eb0e3: Pull complete
d3288bceb92d: Pull complete
410aa06ed26b: Pull complete
6d828875da7d: Pull complete
7cc67dc49caa: Pull complete
Digest: sha256:6d985a966d7bfd05b8f3a965d3da5e7f6da4a8f87cc645ddab7565c4eaf6d2bb
Status: Downloaded newer image for mysql:latest
搞定,下面就要深入学习Docker了。加油