Sentry - Self Hosted Installation with Proxy

Viewed 57

I'm trying to install Sentry following the self hosted guide here https://github.com/getsentry/self-hosted. I'm behind a proxy and I don't know how to set the right env var.

I followed this: https://forum.sentry.io/t/setup-sentry-on-premise-on-a-server-with-http-proxy/9929 so I set the ARGS in the Dockerfile in sentry/Dockerfile and cron/Dockerfile:

sentry/Dockerfile

ARG SENTRY_IMAGE
ARG https_proxy=host:port
ARG http_proxy=host:port
ARG no_proxy=127.0.0.1,some IP*...
ARG ftp_proxy=host:port

FROM ${SENTRY_IMAGE}
.
.
.

cron/Dockerfile

ARG https_proxy=host:port
ARG http_proxy=host:port
ARG no_proxy=127.0.0.1,some IP*...
ARG ftp_proxy=host:port

FROM ${BASE_IMAGE}
.
.
.

Then I set the docker env in the /.docker/config.json https://airman604.medium.com/getting-docker-to-work-with-a-proxy-server-fadec841194e#002b here the check:

[root@sentry self-hosted-22.7.0]# sudo systemctl daemon-reload
[root@sentry self-hosted-22.7.0]# sudo systemctl restart docker
[root@sentry self-hosted-22.7.0]# systemctl show --property=Environment docker
Environment=HTTPS_PROXY=host:port HTTP_PROXY=host:port NO_PROXY=127.0.0.1,some IP*...

I tried to change the /etc/resolv.conf too putting in the google DNS, but when i reload the NetworkManager service, my previous nameserver came back.

I also tried to add the "dockerfile: Dockerfile.name" in the docker.compose following this, docker-compose build and http_proxy but I can't understand where and if I had to put it in all the build. My try was to put it here:

image: sentry-self-hosted-local
  # Set the platform to build for linux/arm64 when needed on Apple silicon Macs.
  platform: ${DOCKER_PLATFORM:-}
  build:
    context: ./sentry
    ****dockerfile: Dockerfile****
    args:
      - SENTRY_IMAGE
  depends_on:

with no luck.

In all these cases, when I launch the install.sh I always got this error:

`#37 0.297 Err:8 http://deb.debian.org/debian stretch/main amd64 Packages
#37 0.297 Unsupported proxy configured: host://port
#37 0.297 Ign:9 http://deb.debian.org/debian stretch/main all Packages
#37 0.298 Err:11 http://deb.debian.org/debian stretch-updates/main amd64 Packages
#37 0.298 Unsupported proxy configured: host://port
#37 0.298 Ign:7 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
#37 0.298 Ign:12 http://deb.debian.org/debian stretch-updates/main all Packages
#37 0.298 Ign:10 http://security.debian.org/debian-security stretch/updates/main all Packages
#37 0.300 Err:7 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
#37 0.300 Unsupported proxy configured: host://port
#37 0.300 Ign:10 http://security.debian.org/debian-security stretch/updates/main all Packages
#37 0.305 Reading package lists...
#37 CANCELED

#22 [snuba-cleanup-self-hosted-local 4/5] RUN apt-get update && apt-get install -y --no-install-recommends cron && rm -r /var/lib/apt/lists/*
#22 CANCELED
[sentry-cleanup-self-hosted-local 4/5] RUN apt-get update && apt-get install -y --no-install-recommends cron && rm -r /var/lib/apt/lists/*:
#0 0.318 Err:4 http://security.debian.org/debian-security bullseye-security Release
#0 0.318 Unsupported proxy configured: host://port
#0 0.318 Err:5 http://deb.debian.org/debian bullseye Release
#0 0.318 Unsupported proxy configured: host://port
#0 0.318 Err:6 http://deb.debian.org/debian bullseye-updates Release
#0 0.318 Unsupported proxy configured: host://port
#36 0.320 Reading package lists...
#36 0.329 E: The repository 'http://security.debian.org/debian-security bullseye-security Release' does not have a Release file.
#36 0.329 E: The repository 'http://deb.debian.org/debian bullseye Release' does not have a Release file.
#36 0.329 E: The repository 'http://deb.debian.org/debian bullseye-updates Release' does not have a Release file.

failed to solve: executor failed running [/bin/sh -c apt-get update && apt-get install -y --no-install-recommends cron && rm -r /var/lib/apt/lists/*]: exit code: 100
An error occurred, caught SIGERR on line 7
Cleaning up...
`

Any ideas?

Thank you, Luca

1 Answers

Neither sentry/Dockerfile nor cron/Dockerfile should be modified.

Configuring proxy for docker build and docker compose will enable you to run the commands that require internet access during the image build process.

This configuration is done by creating the file /.docker/config.json with the following content. Replace the proxy_server_host and proxy_server_port with your proxy server host IP and port respectively.

{
 "proxies":
 {
   "default":
   {
     "httpProxy": "http://proxy_server_host:proxy_server_port",
     "httpsProxy": "https://proxy_server_host:proxy_server_port",
     "noProxy": "localhost,127.0.0.1"
   }
 }
}
Related