Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dockerfile to fix #7529 #7532

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MatthiasJobst
Copy link

@MatthiasJobst MatthiasJobst commented Aug 16, 2023

Add --noproxy for localhost to prevent from using a proxy for this request

Describe the pull request

This PR fixes #7529.

When the environment variables HTTP_PROXY and/or HTTPS_PROXY are set, the routing even for localhost goes through the proxy. In cases where the docker image uses a port redirection this request fails.
When accessing itself as a host a proxy is not really needed so this is disabled in the HEALTHCHECK.

Link to the issue: #7529

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code or have provided the test plan.

Test plan

This fix can be verified by starting a docker container with the following additional parameters: -e HTTP_PROXY=host.docker.internal -e HTTPS_PROXY=host.docker.internal. When this fix is not present a docker inspect or a docker ps will show the container as unhealthy. With this fix the container is healthy.

A command for verification could look like this:

docker run -d -e HTTP_PROXY=host.docker.internal -e HTTPS_PROXY=host.docker.internal --name gogs_test gogs/gogs:latest

docker ps gogs_test

Add --noproxy for localhost to prevent from using a proxy for this request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker health check is not working when using a proxy
1 participant