天天看點

Docker 實作阿裡雲加速

阿裡雲加速

[root@FantJ ~]# tee /etc/docker/daemon.json <<-'EOF'
> {
>   "registry-mirrors": ["https://wghlmi3i.mirror.aliyuncs.com"]
> }
> EOF
{
  "registry-mirrors": ["https://wghlmi3i.mirror.aliyuncs.com"]
}
[root@FantJ ~]# cat /etc/docker/daemon.json 
{
  "registry-mirrors": ["https://wghlmi3i.mirror.aliyuncs.com"]
}

           

其實就是添加了一個registry-mirrors的一個鍵值對。然後重加載該檔案,重新開機服務

[root@FantJ ~]# systemctl daemon-reload
[root@FantJ ~]# systemctl restart docker