I have a docker daemon running behind an HTTP proxy.
My Dockerfile's look like this:
FROM alpine:latest
RUN apk add --no-cache make gcc
Normally I configure the proxy by adding the http_proxy environment variable to the Dockerfile:
FROM alpine:latest
ENV http_proxy http://myproxy.mydomain.com:8080/
RUN apk add --no-cache make gcc
And that works fine.
But I don't want to touch the Dockerfile because it is also used in other environments where the proxy isn't available. I don't want to have ENV http_proxy ... in the Dockerfile at all.
So my question is: how to add an environment variable to all containers without touching the Dockerfiles?