-
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 special IP designator host-gateway
in --add-host
.
#14390
Comments
I wrote a quick baseline implementation that has the behavior I am hoping for with respect to this command line option, but I don't have enough knowledge of how the libpod systems work to know if having this PR: #14392 |
@rhatdan You can take the man out of the pod, but not the pod out of the man. |
The issue is really about compatibility with the docker CLI for the purposes of using podman with scripts that call It's also a container instance setting, not a global engine setting. The CLI option in moby-engine allows mapping any arbitrary hostname to
Let's say my local IP is
|
A friendly reminder that this issue had no activity for 30 days. |
@willmtemple Do you still work on this? |
A friendly reminder that this issue had no activity for 30 days. |
@Luap99 can you take it over? |
@dkliban you got it. |
After upgrading to podman 4.1 I realized that |
I've just hit this. My slightly crazy use case is to 'override' a particular hostname to resolve to the host's IP in the container. Unfortunately that hostname is not 'host.containers.internal', so the existing automatic entry doesn't quite cut it. (But perhaps my use case is too weird to be a justification for this feature...) |
@dkliban Any movement on this |
A friendly reminder that this issue had no activity for 30 days. |
@Luap99 Any chance you can work on this? |
Hey I've run into this as well. My use case is, that I am running podman-compose and sharing a compose-file with co-workers who are using docker-compose. podman-compose just forwards the extra_hosts configured in the compose-file to podman which unfortunately leads to the problem, that podman does not understand Soo given all of this. Any chance to get the PR merged? Is the missing documentation string really all that is holding us back here? I would gladly add that if that is all it takes. |
Just need to get someone to work on it. |
#14392 appears to have been abandoned. Does that PR require any additional efforts beyond updating the comment function and a rebase? |
@Nauscar This #14392 (review) is still valid, the change must be made in containers/common to support both podman and buildah. |
@Nauscar if you want to take if over, that would be great. |
This change adds support for the special IP designator `host-gateway` to the etchosts package. The first part of fixing containers/podman#14390 Signed-off-by: Gregor Eichelberger <[email protected]>
This change adds support for the special IP designator `host-gateway` to the etchosts package. The first part of fixing containers/podman#14390 Signed-off-by: Gregor Eichelberger <[email protected]>
This was fixed in containers/common#1549 and #19152 and will be included in podman v4.7 |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature
Description
Related: #8466
Podman doesn't support
host-gateway
as a special IP designator when creating a container. Instead it creates an automatic mapping fromhost.containers.internal
to the host NIC's IP address, but unfortunately that doesn't really help in situations involving scripts that calldocker
, where the host has the podmandocker
CLI shim installed.This is one of those argument configurations (
--add-host host.docker.internal:host-gateway
) that floats around on the web as a solution for the problem of "talking to the host" when using docker, so it ends up integrated into a fair amount of tools that call the docker CLI. It'd be nice if podman could support this argument well for compatibility.Steps to reproduce the issue:
host-gateway
mapping:podman run --rm --add-host foobar:host-gateway fedora
Describe the results you received:
Describe the results you expected:
As with moby-engine:
I'll spare you all the additional info in the issue template, since this is just a feature request.
Notes:
Unless
ContainerConfig.HostAdd
is used in other places, I think this can be implemented by special-casinghost-gateway
as an IP string inValidateExtraHost
and then in libpod/container_internal_linuxContainer#createHosts
by simply mapping over the extra hosts and replacing any that havehost-gateway
as their IP string with the selected host IP from libnetwork.The text was updated successfully, but these errors were encountered: