From 6ee61a7925bf1d1f346a184aaea3ca14cc898818 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 24 Jan 2024 21:33:42 +1100 Subject: [PATCH] Move setting HTTP_PROXY to variable --- .gitlab-docker-arm64.yml | 2 +- .gitlab-docker-armv7l.yml | 2 +- .gitlab-docker-x86_64.yml | 2 +- Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-docker-arm64.yml b/.gitlab-docker-arm64.yml index 23dbc10..ad8520d 100644 --- a/.gitlab-docker-arm64.yml +++ b/.gitlab-docker-arm64.yml @@ -5,7 +5,7 @@ arm64:build: script: - if [ -f init ]; then chmod 500 init; fi - ([ -z "$REFRESH" -a -f docker/${CI_COMMIT_REF_SLUG} ]) && docker load < docker/${CI_COMMIT_REF_SLUG} || true - - docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} . + - docker build ${HTTP_PROXY:+--build-arg HTTP_PROXY=${HTTP_PROXY}} --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} . - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH} - docker save ${CI_REGISTRY_IMAGE}:${VERSIONARCH} > docker/${CI_COMMIT_REF_SLUG} tags: diff --git a/.gitlab-docker-armv7l.yml b/.gitlab-docker-armv7l.yml index 8b8641c..48fe6a6 100644 --- a/.gitlab-docker-armv7l.yml +++ b/.gitlab-docker-armv7l.yml @@ -5,7 +5,7 @@ armv7l:build: script: - if [ -f init ]; then chmod 500 init; fi - ([ -z "$REFRESH" -a -f docker/${CI_COMMIT_REF_SLUG} ]) && docker load < docker/${CI_COMMIT_REF_SLUG} || true - - docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} . + - docker build ${HTTP_PROXY:+--build-arg HTTP_PROXY=${HTTP_PROXY}} --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} . - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH} - docker save ${CI_REGISTRY_IMAGE}:${VERSIONARCH} > docker/${CI_COMMIT_REF_SLUG} tags: diff --git a/.gitlab-docker-x86_64.yml b/.gitlab-docker-x86_64.yml index a68a1f4..f66c5c8 100644 --- a/.gitlab-docker-x86_64.yml +++ b/.gitlab-docker-x86_64.yml @@ -5,7 +5,7 @@ x86_64:build: script: - if [ -f init ]; then chmod 500 init; fi - ([ -z "$REFRESH" -a -f docker/${CI_COMMIT_REF_SLUG} ]) && docker load < docker/${CI_COMMIT_REF_SLUG} || true - - docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} . + - docker build ${HTTP_PROXY:+--build-arg HTTP_PROXY=${HTTP_PROXY}} --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} . - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH} - docker save ${CI_REGISTRY_IMAGE}:${VERSIONARCH} > docker/${CI_COMMIT_REF_SLUG} tags: diff --git a/Dockerfile b/Dockerfile index 04a1842..fef267c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM nginx:alpine # Change to http respositories, so they we can cache the install packages -RUN if [ -n ${HTTP_PROXY} ] ; then sed -i -e s'/https/http/' /etc/apk/repositories; fi +RUN if [ -n "${HTTP_PROXY}" ] ; then echo "Using HTTP PROXY [${HTTP_PROXY}]" && sed -i -e s'/https/http/' /etc/apk/repositories; fi RUN apk add --no-cache nginx nginx-mod-mail bash