-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[DOCKER] extra_hosts ignored #387
Comments
see golang/go#35305 |
Thanks @ploxiln! I mounted /etc/nsswitch.conf and this fixed my issue. |
This is a known issue with nonglibc systems and golang statically linked builds. In this case, the resolver follows glibc's arguably broken behavior of dns first, then /etc/hosts second in the absence of nsswitch.conf. This also shows up with weirdness's such as 'localhost' resolving to your own domain's version if you have one. For something security sensitive like oauth2_proxy, I'd recommend putting an explicit nsswitch.conf into the official container via the Dockerfile. This will affect other users unexpectedly, and not just this one user. Please reopen the ticket. |
I've reopened this as @kfox1111 has asked. I've worked around this by mounting my nsswitch.conf as a volume, but it would be best to add it into the Dockerfile directly. |
This seems like a reasonable solution, can someone raise a PR? |
I’ll work on this at some point during the next fortnight hopefully
|
When specifying extra_hosts (to modify the container's hosts file), these are ignored.
Expected Behavior
When getting the openid-configuration from the Keycloak URL, it should be using the specified IP address to get to the login server, not the publicly resolvable IP.
Current Behavior
It is still using the public IP, and due to firewall configuration this isn't working.
Steps to Reproduce (for bugs)
Run the service in Docker using the following docker-compose.yml snippet:
Context
The OAuth2 proxy cannot get the OpenID Configuration which means users cannot authenticate.
Your Environment
The text was updated successfully, but these errors were encountered: