docker pull 设置代理 - docker - linux

栏目: 编程工具 · 发布时间: 6年前

内容简介:你在终端设置代理的时候docker pull的时候是不会走代理的,下面是docker pull设置代理的正确方式环境是在centos下,如果没有新建下面这个文件夹

docker pull 设置代理 - docker - linux

你在终端设置代理的时候docker pull的时候是不会走代理的,下面是docker pull设置代理的正确方式

操作

环境是在centos下,如果没有新建下面这个文件夹

sudo mkdir -p /etc/systemd/system/docker.service.d

之后新建下面这个文件走http代理

vim /etc/systemd/system/docker.service.d/http-proxy.conf

填入

[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"

编辑下面这个文件走https代理

vim /etc/systemd/system/docker.service.d/https-proxy.conf

[Service]
Environment="HTTPS_PROXY=https://proxy.example.com:443/"

之后你使用docker pull的时候就可以pull gcr.io上的镜像了

详细可以看下面

https://docs.docker.com/config/daemon/systemd/

欢迎关注Bboysoul的博客www.bboysoul.com

Have Fun


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Data Structures and Algorithms in Java

Data Structures and Algorithms in Java

Robert Lafore / Sams / 2002-11-06 / USD 64.99

Data Structures and Algorithms in Java, Second Edition is designed to be easy to read and understand although the topic itself is complicated. Algorithms are the procedures that software programs use......一起来看看 《Data Structures and Algorithms in Java》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码