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

Add 'pre-defined/reserved' internal hostnames #19361

Closed
benoitf opened this issue Jul 25, 2023 · 7 comments
Closed

Add 'pre-defined/reserved' internal hostnames #19361

benoitf opened this issue Jul 25, 2023 · 7 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine podman-desktop

Comments

@benoitf
Copy link
Contributor

benoitf commented Jul 25, 2023

Feature request description

Some containers are using some predefined docker hosts like host.docker.internal or gateway.docker.internal

Then, these containers are failing during their execution as these hosts don't exists

It seems that there is host.containers.internal and gateway.containers.internal https://github.com/containers/gvisor-tap-vsock/blob/049be485f9a50ecbc8fb1aed9a040ceeead4e864/cmd/gvproxy/main.go#L187-L194

but for compatibility with Docker I think it would be nice if host.docker.internal and gateway.docker.internal were aliased to host.containers.internal. and gateway.containers.internal

Suggest potential solution

Add alias from host.docker.internal to host.containers.internal. and gateway.docker.internal to gateway.containers.internal

Have you considered any alternatives?

N/A

Additional context

I found that while testing digma-ai app with Podman

https://github.com/search?q=org%3Adigma-ai+host.docker.internal&type=code

related docker documentation: https://docs.docker.com/desktop/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host

@benoitf benoitf added kind/feature Categorizes issue or PR as related to a new feature. podman-desktop labels Jul 25, 2023
@rhatdan
Copy link
Member

rhatdan commented Jul 25, 2023

@Luap99 PTAL

@Luap99
Copy link
Member

Luap99 commented Jul 26, 2023

I don't know the history of why we choose this name over the docker one but I will try to dig it up.
In general I have no issues in adding the docker entry as well, however that would need to happen both in gvproxy for podman machines and the normal /etc/hosts handling in c/common for the local podman.

@rhatdan
Copy link
Member

rhatdan commented Jul 27, 2023

We wanted to have a name without the letters "docker" but it turns out some customers built this functionality into the container images.

@Luap99
Copy link
Member

Luap99 commented Aug 1, 2023

I mean adding the entry is simple and because it helps converting existing workloads depending on it I think we should just add them.

@Luap99 Luap99 self-assigned this Aug 1, 2023
@Luap99 Luap99 added the machine label Aug 1, 2023
Luap99 added a commit to Luap99/gvisor-tap-vsock that referenced this issue Aug 1, 2023
Some tools hard code the `host.docker.internal` dns name so it is not
possible to run them with podman right now. Adding the entry is simple
so we should support it for better compatibility.

Also remove the comment that podman depends on crc.testing, it does not
for a long time now. But because I do not know if crc needs it I left it
in there.

see containers/podman#19361

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/gvisor-tap-vsock that referenced this issue Aug 1, 2023
Some tools hard code the `host.docker.internal` dns name so it is not
possible to run them with podman right now. Adding the entry is simple
so we should support it for better compatibility.

Also remove the comment that podman depends on crc.testing, it does not
for a long time now. But because I do not know if crc needs it I left it
in there.

see containers/podman#19361

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@Luap99
Copy link
Member

Luap99 commented Aug 1, 2023

will be added with containers/gvisor-tap-vsock#251 and containers/common#1592

Luap99 added a commit to Luap99/common that referenced this issue Aug 1, 2023
Some tools hard code the `host.docker.internal` dns name so it is not
possible to run them with podman right now. Adding the entry is simple
so we should support it for better compatibility.

see containers/podman#19361

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/gvisor-tap-vsock that referenced this issue Aug 1, 2023
Some tools hard code the `host.docker.internal` dns name so it is not
possible to run them with podman right now. Adding the entry is simple
so we should support it for better compatibility.

Also remove the comment that podman depends on crc.testing, it does not
for a long time now. But because I do not know if crc needs it I left it
in there.

see containers/podman#19361

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/gvisor-tap-vsock that referenced this issue Aug 4, 2023
Some tools hard code the `host.docker.internal` dns name so it is not
possible to run them with podman right now. Adding the entry is simple
so we should support it for better compatibility.

Also remove crc.testing, podman does not depend on it since at least
v4.0 and it seems like there are no other users.

see containers/podman#19361

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/gvisor-tap-vsock that referenced this issue Aug 4, 2023
Some tools hard code the `host.docker.internal` dns name so it is not
possible to run them with podman right now. Adding the entry is simple
so we should support it for better compatibility.

Also remove crc.testing, podman does not depend on it since at least
v4.0 and it seems like there are no other users.

see containers/podman#19361

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@vrothberg
Copy link
Member

@Luap99 I assume this is done, is it?

@Luap99
Copy link
Member

Luap99 commented Aug 22, 2023

Ah yes, code changes are merged.
I assume it will be part of podman 4.7 for the c/common side and it needs a new gvproxy release.

@Luap99 Luap99 closed this as completed Aug 22, 2023
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Nov 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine podman-desktop
Projects
None yet
Development

No branches or pull requests

4 participants