Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

https://docs.docker.com/config/daemon/systemd/#httphttps-proxy

https://stackoverflow.com/questions/23111631/cannot-download-docker-images-behind-a-proxy

https://stackoverflow.com/questions/27749193/how-to-build-docker-images-with-dockerfile-behind-http-proxy-by-jenkins

https://docs.docker.com/network/proxy/#configure-the-docker-client

cat << "EOF" >~/proxy_setup.sh

#Proxy
ActiveProxyVar=127.0.0.1:80


#Domain
domainvar=domain.com

httpproxyvar=http://$ActiveProxyVar/
httpsproxyvar=http://$ActiveProxyVar/
ftpproxyvar=ftp://$ActiveProxyVar/

cat << EOL >/etc/environment
no_proxy=localhost, 127.0.0.1, *.$domainvar
NO_PROXY=localhost, 127.0.0.1, *.$domainvar
http_proxy="$httpproxyvar"
HTTP_PROXY="$httpproxyvar"
https_proxy="$httpsproxyvar"
HTTPS_PROXY="$httpsproxyvar"
ftp_proxy="$ftpproxyvar"
FTP_PROXY="$ftpproxyvar"
EOL
cat /etc/environment

cat << EOL >/etc/apt/apt.conf.d/95proxies
Acquire::http::proxy "$httpproxyvar";
Acquire::ftp::proxy "$ftpproxyvar";
Acquire::https::proxy "$httpsproxyvar";
EOL
cat /etc/apt/apt.conf.d/95proxies

EOF
chmod +x ~/proxy_setup.sh
~/proxy_setup.sh

cat << 'EOF' >~/crt_import.sh
#!/bin/bash

dirname=zscaler
crtname=ZscalerRootCertificate-2048-SHA256

mkdir /usr/local/share/ca-certificates/$dirname
cat << EOL >/usr/local/share/ca-certificates/$dirname/$crtname.crt
-----BEGIN CERTIFICATE-----
....
-----END CERTIFICATE-----
EOL
update-ca-certificates
EOF
chmod +x ~/crt_import.sh
~/crt_import.sh

echo "reboot or export environment variables before moving forward"
  • No labels