Changed the way http proxy configuration is injected.

This commit is contained in:
László Valkó 2019-01-29 04:43:56 +01:00
parent 5947080262
commit 6fa496588c
2 changed files with 12 additions and 5 deletions

View file

@ -1,9 +1,14 @@
FROM alpine FROM alpine
ARG http_proxy ARG HTTP_PROXY_HOST
ARG https_proxy ARG HTTP_PROXY_PORT
ARG HTTPS_PROXY_HOST
ARG HTTPS_PROXY_PORT
RUN apk add --no-cache openldap openldap-clients openldap-back-ldap openldap-overlay-deref ldapvi && mkdir -p /run/openldap RUN \
if [ -n "$HTTP_PROXY_HOST" -a -n "$HTTP_PROXY_PORT" ]; then export http_proxy=http://$HTTP_PROXY_HOST:$HTTP_PROXY_PORT; fi && \
if [ -n "$HTTPS_PROXY_HOST" -a -n "$HTTPS_PROXY_PORT" ]; then export https_proxy=http://$HTTPS_PROXY_HOST:$HTTPS_PROXY_PORT; fi && \
apk add --no-cache openldap openldap-clients openldap-back-ldap openldap-overlay-deref ldapvi && mkdir -p /run/openldap
COPY root / COPY root /

View file

@ -5,8 +5,10 @@ services:
build: build:
context: . context: .
args: args:
http_proxy: ${http_proxy} HTTP_PROXY_HOST: ${HTTP_PROXY_HOST}
https_proxy: ${https_proxy} HTTP_PROXY_PORT: ${HTTP_PROXY_PORT}
HTTPS_PROXY_HOST: ${HTTPS_PROXY_HOST}
HTTPS_PROXY_PORT: ${HTTPS_PROXY_PORT}
container_name: ldap.proxy container_name: ldap.proxy
networks: networks:
- ldap.proxy - ldap.proxy