Centos Docker安装、升级、卸载 https://juejin.im/post/5c35c7496fb9a049e93ceb83 默认源: docker.io 设置镜像仓库源 Docker 官方中国区: https://registry.docker-cn.com 网易: http://hub-mirror.c.163.com 中科大: https://docker.mirrors.ustc.edu.cn 新版docker: /etc/docker/daemon.json { "registry-mirrors": ["https://registry.docker-cn.com"] } 拉取指定仓库(源)的镜像 docker login registry.cn-hangzhou.aliyuncs.com docker pull registry.cn-hangzhou.aliyuncs.com/postgres 配置网络代理 方法一: /etc/sysconfig/docker http_proxy=http://proxyhk.zte.com.cn:80/ https_proxy=https://proxyhk.zte.com.cn:80/ no_proxy=10.0.0.0/8,192.0.0.0/8,registry,*.xxx.com.cn,localhost,127.0.0.0/8,::1 方法二: 配置docker.service mkdir -p /etc/systemd/system/docker.service.d cat >> /etc/systemd/system/docker.service.d/http-proxy.conf << EOF [Service] Environment=("HTTP_PROXY=http://proxyhk.zte.com.cn:80/" \ "HTTPS_PROXY=https://proxyhk.zte.com.cn:80/" \ "NO_PROXY=10.0.0.0/8,192.0.0.0/8,registry,*.zte.com.cn,localhost,127.0.0.0/8,::1") EOF 配置生效 systemctl daemon-reload && systemctl restart docker
转载于:https://www.cnblogs.com/wenlin-gk/p/11059554.html