1. configuration directory 생성

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

 

2. configuration file 생성 및 환경 구성

$ sudo vi /etc/systemd/system/docker.service.d/proxy.conf

 

생성된 file에 아래와 같이 환경 구성을 기록하고 저장한다.

[Service]
Environment="HTTP_PROXY=http://proxy.server:port/"
Environment="HTTPS_PROXY=http://proxy.server:port/"
Environment="NO_PROXY="localhost,127.0.0.1,::1"

 

사용예)

[Service]
Environment="HTTP_PROXY=http://10.10.10.5:8080/"
Environment="HTTPS_PROXY=http://10.10.10.5:8080/"
Environment="NO_PROXY="localhost,127.0.0.1,::1"

 

3. daemon 재수행

$ sudo systemctl daemon-reload

 

4. docker service 재수행

$ sudo systemctl restart docker.service

 

반응형

'Linux > Proxy' 카테고리의 다른 글

Proxy setting, jupyter notebook  (0) 2020.02.06
Proxy setting, conda (Windows)  (0) 2019.12.08
Proxy setting, pip (ubuntu)  (0) 2019.11.08
Proxy setting, conda (ubuntu 18.04)  (0) 2019.11.08
Proxy setting, apt-get (ubuntu 18.04)  (0) 2019.11.08

+ Recent posts