docker 拉取超时, 配置代理 docker



-e  HTTP_PROXY="http://h.htmltoo.com:7778"

-e  HTTPS_PROXY="http://h.htmltoo.com:7778"

-e  FTP_PROXY="ftp://h.htmltoo.com:21"

-e  NO_PROXY="*.test.example.com,.example2.com"


vim  /etc/docker/daemon.json


-增加下载超时时间

{
  "default-ulimits": {
    "nofile": {
      "Name": "nofile",
      "Hard": 1048576,
      "Soft": 1048576
    }
  },
  "max-concurrent-downloads": 10
}


-使用代理服务器

{
  "proxies": {
    "default": {
      "httpProxy": ["http://h.htmltoo.com:7778"],
      "httpsProxy": ["http://h.htmltoo.com:7778"],
      "noProxy": ["*.test.example.com,.example.org,127.0.0.0/8"]
    }
  }
}


systemctl daemon-reload

systemctl restart docker


-临时

export http_proxy="http://h.htmltoo.com:7778"

export https_proxy="http://h.htmltoo.com:7778"

-永久

vim  /root/.bashrc

http_proxy="http://h.htmltoo.com:7778"
export http_proxy


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回