Note: Docker 1.9 might help solve this:
- “Issue 14634”: Builder – Build-time argument passing (e.g.,
HTTP_PROXY
) - “PR 15182”: Support for passing build-time variables in build context
Usage (proposed):
docker build --build-arg http_proxy=http://my.proxy.url --build-arg foo=bar <<MARK
FROM busybox
RUN <command that need http_proxy>
ARG --description="foo's description" foo
USER $foo
MARK