From 3d39d971000d5af7255789275ba07317a031e5da Mon Sep 17 00:00:00 2001 From: goganchic Date: Sun, 26 Jun 2022 11:17:54 +0300 Subject: [PATCH 1/4] configure apt-get to use http_proxy if required --- cron/Dockerfile | 2 ++ install/build-docker-images.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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/install/build-docker-images.sh b/install/build-docker-images.sh index 63bb0dac429..80dcfcc80ae 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." From 7859b76e97ebf086b1f24a01fdb4f4040f15b6b1 Mon Sep 17 00:00:00 2001 From: goganchic Date: Sun, 26 Jun 2022 11:42:35 +0300 Subject: [PATCH 2/4] force disable http_proxy for health check --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index a38d1158ea4..866a827d5e3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -211,7 +211,7 @@ services: test: [ "CMD-SHELL", - "wget -nv -t1 --spider 'http://localhost:8123/' || exit 1", + "http_proxy='' wget -nv -t1 --spider 'http://localhost:8123/' || exit 1", ] interval: 3s timeout: 600s From a4751e82e6626982dc1e5cf07b06cc86f48e6f77 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Tue, 28 Jun 2022 13:26:38 -0400 Subject: [PATCH 3/4] Update install/build-docker-images.sh Fix in the case where vars are empty --- install/build-docker-images.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/build-docker-images.sh b/install/build-docker-images.sh index 80dcfcc80ae..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 --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 +$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." From 9034e037410ee7776774635d380a9d13b6b7e954 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Tue, 28 Jun 2022 17:36:28 -0400 Subject: [PATCH 4/4] Comment on the http_proxy wget thing --- docker-compose.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 866a827d5e3..cfb9bb5d3d4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -211,6 +211,9 @@ services: test: [ "CMD-SHELL", + # 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