加速Docker-Pull或者docker-compose拉取镜像-适用github源

为github的docker源提速

下载zlib(github上的)非常幸苦,速度极慢

找到了大神的文章:加速docker pull

有什么用

为github的docker源提速,比如:

ghcr.io/zlib-searcher/zlib-searcher:latest

ghcr.io/puzzithinker/zlib-searcher:master

怎么用

  1. 配置http-proxy.conf
mkdir -p /etc/systemd/system/docker.service.d
vim /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://192.168.1.1:7890"
  1. 配置https-proxy.conf

vim /etc/systemd/system/docker.service.d/https-proxy.conf
[Service]
Environment="HTTPS_PROXY=http://192.168.1.1:7890"
#这个设置是难点,踩坑折腾了半小时左右,一直监控着clash.meta的UI,docker pull过程到底有没有走proxy,设置对了以后,速度果然一下子,嗖.....
  1. 重启服务
sudo systemctl daemon-reload
sudo systemctl restart docker
  1. 监控一下是否正常走了设置的代理

相关内容

灵感来源

https://zu1k.com/posts/coding/speedup-docker-pull/#为docker设置代理

假如Docker image的源repository被删除了

You will need to save the Docker image as a tar file:

> docker save -o <path for generated tar file> <image name>
Then copy your image to a new system with regular fi...

......

继续阅读

请点击访问最新版内容

posted @ 2024-01-16 09:38  CarlZeng  阅读(430)  评论(0编辑  收藏  举报