diff --git a/cron/Dockerfile b/cron/Dockerfile index 14b901fd0d1..edb6407fdb3 100644 --- a/cron/Dockerfile +++ b/cron/Dockerfile @@ -1,6 +1,8 @@ ARG BASE_IMAGE FROM ${BASE_IMAGE} USER 0 +RUN if [ -z "${http_proxy}" ]; then echo "Acquire::http::proxy \"${http_proxy}\";" >> /etc/apt/apt.conf; fi +RUN if [ -z "${https_proxy}" ]; then echo "Acquire::https::proxy \"${https_proxy}\";" >> /etc/apt/apt.conf; fi RUN apt-get update && apt-get install -y --no-install-recommends cron && \ rm -r /var/lib/apt/lists/* COPY entrypoint.sh /entrypoint.sh diff --git a/docker-compose.yml b/docker-compose.yml index a38d1158ea4..cfb9bb5d3d4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -211,7 +211,10 @@ services: test: [ "CMD-SHELL", - "wget -nv -t1 --spider 'http://localhost:8123/' || exit 1", + # Manually override any http_proxy envvar that might be set, because + # this wget does not support no_proxy. See: + # https://github.com/getsentry/self-hosted/issues/1537 + "http_proxy='' wget -nv -t1 --spider 'http://localhost:8123/' || exit 1", ] interval: 3s timeout: 600s diff --git a/install/build-docker-images.sh b/install/build-docker-images.sh index 63bb0dac429..671597eec46 100644 --- a/install/build-docker-images.sh +++ b/install/build-docker-images.sh @@ -3,8 +3,8 @@ echo "${_group}Building and tagging Docker images ..." echo "" # Build any service that provides the image sentry-self-hosted-local first, # as it is used as the base image for sentry-cleanup-self-hosted-local. -$dc build --force-rm web -$dc build --force-rm +$dc build --build-arg "http_proxy=${http_proxy:-}" --build-arg "https_proxy=${https_proxy:-}" --build-arg "no_proxy=${no_proxy:-}" --force-rm web +$dc build --build-arg "http_proxy=${http_proxy:-}" --build-arg "https_proxy=${https_proxy:-}" --build-arg "no_proxy=${no_proxy:-}" --force-rm echo "" echo "Docker images built."