"Docker 프록시 설정하기"의 두 판 사이의 차이

 
(같은 사용자의 중간 판 4개는 보이지 않습니다)
2번째 줄: 2번째 줄:
;Docker 프록시 설정
;Docker 프록시 설정


==현재버전==
<syntaxhighlight lang='bash'>
mkdir -p ~/.docker
vi ~/.docker/config.json
</syntaxhighlight>
<syntaxhighlight lang='json'>
{
"proxies": {
  "default": {
    "httpProxy": "http://proxy.example.com:3128",
    "httpsProxy": "https://proxy.example.com:3129",
    "noProxy": "*.test.example.com,.example.org,127.0.0.0/8"
  }
}
}
</syntaxhighlight>
==옛날버전==
<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
sudo -i
mkdir -p /etc/systemd/system/docker.service.d
mkdir -p /etc/systemd/system/docker.service.d
</syntaxhighlight>
</syntaxhighlight>
26번째 줄: 9번째 줄:
cat <<EOF > /etc/systemd/system/docker.service.d/http-proxy.conf
cat <<EOF > /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"
Environment="HTTP_PROXY=http://proxy.example.com:3128"
Environment="HTTPS_PROXY=https://proxy.example.com:3129"
Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"
Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"
EOF
EOF
33번째 줄: 17번째 줄:
systemctl daemon-reload
systemctl daemon-reload
systemctl restart docker
systemctl restart docker
systemctl show --property=Environment docker | cat
</syntaxhighlight>
</syntaxhighlight>


39번째 줄: 24번째 줄:
* [[WSL2 도커 프록시 설정하기]]
* [[WSL2 도커 프록시 설정하기]]
* [[/etc/systemd/system/docker.service.d/http-proxy.conf]]
* [[/etc/systemd/system/docker.service.d/http-proxy.conf]]
* [[Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection]]


==참고==
==참고==

2024년 4월 26일 (금) 15:52 기준 최신판

1 개요[ | ]

Docker 프록시 설정
sudo -i
mkdir -p /etc/systemd/system/docker.service.d
cat <<EOF > /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:3128"
Environment="HTTPS_PROXY=https://proxy.example.com:3129"
Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"
EOF
systemctl daemon-reload
systemctl restart docker
systemctl show --property=Environment docker | cat

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}