sudo env https_proxy=http://proxy:8080 docker daemon
sudo docker build --build-arg HTTP_PROXY=$http_proxy -t some/imagename .
//Dockerfile
RUN wget -e http_proxy=$http_proxy ...
Sample environment file:
http_proxy="http://proxy:8080/"
https_proxy="http://proxy:8080/"
ftp_proxy="ftp://proxy:8080/"
no_proxy=".mylan.local,.domain1.com,host1,host2"
Sample Dockerfile:
COPY deps/environment /etc/environment
// If private rpm
// COPY deps/yum.repos.d /etc/yum.repos.d
// COPY deps/rpm-gpg /etc/pki/rpm-gpg
Sample proxysettings file:
Acquire::http::proxy "http://proxy:8080";
Acquire::https::proxy "http://proxy:8080";
Acquire::ftp::proxy "http://proxy:8080";
Sample proxy.sh file:
export http_proxy=http://proxy:8080
export https_proxy=http://proxy:8080
Sample Dockerfile:
COPY proxysettings /etc/apt/apt.conf.d/proxysettings
COPY proxy.sh /etc/profile.d/proxy.sh
RUN ./etc/profile.d/proxy.sh