由于国内的公共加速倒了一大片,导致很多人为docker镜像无法拉取而烦恼

解决办法

使用境外vps反向代理

此处以宝塔为例

新建网站-输入域名 以 docker.ima.cm 为例
申请SSL证书,然后在伪静态设置中输入以下

location / {
   proxy_pass https://registry-1.docker.io;  
   proxy_set_header Host registry-1.docker.io;
   proxy_set_header X-Real-IP $remote_addr;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header X-Forwarded-Proto $scheme;               
   proxy_buffering off;
   proxy_set_header Authorization $http_authorization;
   proxy_pass_header  Authorization;
   proxy_intercept_errors on;
   recursive_error_pages on;
   error_page 301 302 307 = @handle_redirect;
             }
location @handle_redirect {
     resolver 1.1.1.1;
     set $saved_redirect_location '$upstream_http_location';
     proxy_pass $saved_redirect_location;
             }

保存即可.

然后把https://docker.ima.cm加入镜像加速列表

{
  "registry-mirrors": [
    "https://docker.ima.cm"
  ]
}