8000 fix: updating the examples to bind docker/podman 8080 only to localhost by shawkins · Pull Request #39584 · keycloak/keycloak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: updating the examples to bind docker/podman 8080 only to localhost #39584

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

Merged
merged 1 commit into from
May 13, 2025

Conversation

shawkins
Copy link
Contributor
@shawkins shawkins commented May 9, 2025

closes: #39144

This also assumes users are directly using the container locally.

Other considerations: the example could also be shown as as ipv6.

closes: keycloak#39144

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
@shawkins shawkins requested review from a team as code owners May 9, 2025 10:47
@shawkins shawkins requested a review from vmuzikar May 9, 2025 10:48
Copy link
Contributor
@vmuzikar vmuzikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The requirement for -p 127.0.0.1:8080:8080 does seem a bit odd. From the docs:

If host IP is set to 0.0.0.0 or not set at all, the port is bound on all IPs on the host.

Should this rather be a Podman issue then?

Just a side note: on macOS that does seem to work as expected, and -p 8080:8080 binds correctly to localhost.

@shawkins
Copy link
Contributor Author

The requirement for -p 127.0.0.1:8080:8080 does seem a bit odd. From the docs:

If host IP is set to 0.0.0.0 or not set at all, the port is bound on all IPs on the host.

Why would you want to bind to all interfaces over http if only localhost will work correctly? Using any other interface will give you non-secure context warnings.

Should this rather be a Podman issue then?

Given that the change seems benign for Docker, I don't see a reason for it to be Docker specific.

Just a side note: on macOS that does seem to work as expected, and -p 8080:8080 binds correctly to localhost.

Are we worried about users who cling to such odd OSes? :)

Can you clarify what is not working? Can you see what interface it actually is listening on, and are you on an ipv6 only machine or something?

Copy link
Contributor
@vmuzikar vmuzikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you want to bind to all interfaces over http if only localhost will work correctly? Using any other interface will give you non-secure context warnings.

Right, that is another problem. My original understanding was that we're adding 127.0.0.1 to make Podman bind it to localhost and that without it it doesn't work – which seemed to me like a bug actually. But if we actually want to limit it to bind it ONLY to localhost, that makes sense to me.

On the other hand it a bit clutters the example commands.

Given that the change seems benign for Docker, I don't see a reason for it to be Docker specific.

Did you meant "Podman specific"?

Are we worried about users who cling to such odd OSes? :)

Yeah, some of us are still using those. :D

Can you clarify what is not working?

That's the thing – it is working. :) I was just arguing adding 127.0.0.1 might not be necessary.

LGTM, thanks.

@vmuzikar vmuzikar merged commit a74b601 into keycloak:main May 13, 2025
54 checks passed
@shawkins
Copy link
Contributor Author

My original understanding was that we're adding 127.0.0.1 to make Podman bind it to localhost and that without it it doesn't work – which seemed to me like a bug actually

That is correct, it doesn't work on my system without 127.0.0.1 - I see the error message that the user took a screen shot off in the issue.

But if we actually want to limit it to bind it ONLY to localhost, that makes sense to me.

We do also want to limit to localhost in general yes.

Did you meant "Podman specific"?

Yes

That's the thing – it is working. :) I was just arguing adding 127.0.0.1 might not be necessary.

Ah. It's not completely necessary but:

  • access to http over another interface will be a non-secure context
  • it's more secure in general not to expose your dev keycloak instance to the broader world

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting Started Podman: We are sorry... HTTPS required
2 participants
0