docker 设置代理、设置国内镜像源,设置dns

更新于 2024-01-17 19:32 90
专栏: Docker 标签: docker

修改文件:

  1. vim /etc/docker/daemon.json

内容如下:

  1. {
  2. "registry-mirrors": [
  3. "http://hub-mirror.c.163.com",
  4. "https://docker.mirrors.ustc.edu.cn",
  5. "https://registry.docker-cn.com"
  6. ],
  7. "dns": ["8.8.8.8", "8.8.4.4"],
  8. "proxies": {
  9. "default": {
  10. "httpProxy": "http://192.168.3.100:7890",
  11. "httpsProxy": "http://192.168.3.100:7890"
  12. }
  13. }
  14. }

如果不好用可以需要设置内网ip

或者

  1. export HTTP_PROXY=http://192.168.3.100:7890
  2. export HTTPS_PROXY=http://192.168.3.100:7890

BLOG

搜索文章