-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support '--add-host=host.docker.internal:host-gateway' #8466
Comments
@djmattyg007 Interested in opening a PR to enable this? |
Is the basic idea of this that, if I create a container with --add-host=host.podman.internal:host-gateway Then I will end up with an entry in /etc/hosts that looks like |
I don't have the know-how to make this happen sorry.
I'm not sure if it's a requirement to insert it into |
Could someone verify what Docker does in this situation? |
I don't think it really matters how Docker implemented this - they may have chosen to use DNS instead of |
According to the PR I linked:
I suspect it adds just one record for the default bridge network gateway for that container. Presumably if you created another bridge network and made that the default for your container, it would work that out and use that. It's difficult for me to verify exactly how it behaves until there's been a full docker release with this feature included. |
Based on their description, I imagine it's just grabbing the default gateway and using that IP. |
Even that as a starting point would be great, as I suspect one of the most common use cases for this (myself included) is to use it with the globally default network with one-off containers. |
A friendly reminder that this issue had no activity for 30 days. |
Not stale. Waiting on maintainers (who have likely been enjoying their Christmas break <3) to respond. |
@mheon what is the latest on this Issue? |
No activity that I’m aware of. May need to be implemented in the dnsname
plugin?
…On Wed, Jan 6, 2021 at 06:26 Daniel J Walsh ***@***.***> wrote:
@mheon <https://github.com/mheon> what is the latest on this Issue?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8466 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCBA4QU3YYZQNFCECRDSYRCHNANCNFSM4UA3DMNA>
.
|
Lets do that. |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
Not stale. I've been checking regularly for updates only to find none. |
Correct, but best way to get something done is open a PR. :^) |
A friendly reminder that this issue had no activity for 30 days. |
Not stale. |
#9972 will fix |
A friendly reminder that this issue had no activity for 30 days. |
I'm going to close. We don't support the flag, but we are adding the entry to /etc/hosts by default now. |
@mheon any details how to use this? I saw there's a "route" in
But the container does not seem to be able to route to the host:
|
Please open a bug about this - we should probably change over to the host's public IP for rootless containers. |
Hello, |
It is in the code: e.g. https://github.com/docker/cli/blob/a32cd16160f1b41c1c4ae7bee4dac929d1484e59/opts/hosts.go#L32 |
/kind feature
Description
The next version of docker will support the following CLI argument to
docker run
:The magic string
host-gateway
will automatically map to the gateway inside the container (ie. the host machine), allowing you to provide a well-known hostname to use to access the host from inside a container.This feature was discussed and implemented on the following pull request:
moby/moby#40007
As far as I can tell, the latest version of podman does not support this yet.
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Personal physical hardware.
The text was updated successfully, but these errors were encountered: