Set http proxy params for Docker build

This commit is contained in:
bandesz
2016-12-02 14:45:33 +00:00
parent d2ce6f2808
commit a67195a86d
2 changed files with 12 additions and 3 deletions

View File

@@ -1,13 +1,15 @@
FROM python:3.4-slim
ARG APT_HTTP_PROXY
ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY
ENV PYTHONUNBUFFERED=1 \
DEBIAN_FRONTEND=noninteractive
RUN \
echo "Install base packages" \
&& ([ -z "$APT_HTTP_PROXY" ] || echo "Acquire::http::Proxy \"${APT_HTTP_PROXY}\";\n" > /etc/apt/apt.conf.d/99HttpProxy) \
&& ([ -z "$HTTP_PROXY" ] || echo "Acquire::http::Proxy \"${HTTP_PROXY}\";\n" > /etc/apt/apt.conf.d/99HttpProxy) \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
make \