티스토리 뷰

linux

aws linux docker proxy

fendys 2022. 1. 30. 14:25
반응형
  1. Create a systemd drop-in directory for the docker service:
  2. $ sudo mkdir -p /etc/systemd/system/docker.service.d
  3. Create a file named /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:If you are behind an HTTPS proxy server, set the HTTPS_PROXY environment variable:Multiple environment variables can be set; to set both a non-HTTPS and a HTTPs proxy;
  4. [Service] Environment="HTTP_PROXY=http://proxy.example.com:80" Environment="HTTPS_PROXY=https://proxy.example.com:443"
  5. [Service] Environment="HTTPS_PROXY=https://proxy.example.com:443"
  6. [Service] Environment="HTTP_PROXY=http://proxy.example.com:80"
  7. If you have internal Docker registries that you need to contact without proxying you can specify them via the NO_PROXY environment variable.
    • IP address prefix (1.2.3.4)
    • Domain name, or a special DNS label (*)
    • A domain name matches that name and all subdomains. A domain name with a leading “.” matches subdomains only. For example, given the domains foo.example.com and example.com:
    • A single asterisk (*) indicates that no proxying should be done
    • Literal port numbers are accepted by IP address prefixes (1.2.3.4:80) and domain names (foo.example.com:80)
    Config example:
  8. [Service] Environment="HTTP_PROXY=http://proxy.example.com:80" ##Environment="HTTPS_PROXY=https://proxy.example.com:443" -> TLS Error 발생하여 주석처리 하고 정상 작동 Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"
  9. The NO_PROXY variable specifies a string that contains comma-separated values for hosts that should be excluded from proxying. These are the options you can specify to exclude hosts:
  10. Flush changes and restart Docker
  11. $ sudo systemctl daemon-reload $ sudo systemctl restart docker
  12. Verify that the configuration has been loaded and matches the changes you made, for example:
  13. $ sudo systemctl show --property=Environment docker Environment=HTTP_PROXY=http://proxy.example.com:80 HTTPS_PROXY=https://proxy.example.com:443 NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp
반응형

'linux' 카테고리의 다른 글

httpd IndexOptions  (0) 2022.03.01
tcpdump 예제  (0) 2022.02.16
tcp port check  (0) 2022.01.30
리눅스 파일 시스템 동기화 lsync  (0) 2021.11.05
quotas to glusterfs  (0) 2021.10.29