-
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
podman behaves differently than docker regarding /etc/hosts management #13748
Comments
We had this discussion before - I need to find the issue. Regardless, the conclusion was that our way seemed to be more correct, and that there were efforts to patch We could potentially add an option to use the container's |
#11835 is the previous issue. |
So looks like podman 4 has the feature. |
#11835 (comment) says the feature is in version 4, but can't find it in https://docs.podman.io/en/latest/markdown/podman-run.1.html |
I don't remember any PRs to add it, so @rhatdan might have been wrong. |
In my case, this difference in behaviour is causing a functional issue. We have been using version: '3.7'
services:
reverse-proxy:
image: traefik
ports:
- "80:80"
- "443:443"
networks:
default:
aliases:
- app.example.org
- app-identity.example.org
// ...
identity-provider:
// ...
app:
// ... On each developer machine (the host),
The With Docker, this configuration allows the host and each container to access But when using podman, |
We definitely did not merge such changes. I am still looking into rewrting the /etc/hosts stuff and this is on the list as well. But as @mheon said the default will likely stay. I am think of a containers.conf option for that. |
Option in containers.conf SGTM |
It would be a good option for me if the new flag is considered by If you give me some guidance (Golang noob here), I could open a pull request (hopefully better than #13725). Unless someone else want/can implement this quickier 😊 |
We do not add specific flags like that to podman system service. You can change the containers.conf settings yourself so docker clients would not have to set it. I want to get the /etc/hosts stuff done for podman 4.1 in a few weeks. |
I think I haven't been clear enough. I don't want a flag added to |
If you think I can add an option to |
Yes I think this should be added. |
I have the same issue as @reda-alaoui with a similar setup, just different host names. host:
docker-compose
I would look forward to a possibility to be compatible with docker in this regard. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@white-gecko I have been using |
Since it is always possible to add hosts when starting a pod/container using Does any workaround currently exist to get a container started without the host's /etc/hosts when going though the socket? (This is somehow also related to or blocked by #13719) |
base_hosts_file can be used to overwrite the default base host file /etc/hosts which is used to copy hosts entries from this file into the containers /etc/hosts file. As special value "image" can be used to copy the entires from the image hosts file or an empty string "" to not use a base file at all. Ref containers/podman#13277 Ref containers/podman#13748 Signed-off-by: Paul Holzinger <[email protected]>
base_hosts_file can be used to overwrite the default base host file /etc/hosts which is used to copy hosts entries from this file into the containers /etc/hosts file. As special value "image" can be used to copy the entries from the image hosts file or an empty string "" to not use a base file at all. Ref containers/podman#13277 Ref containers/podman#13748 Signed-off-by: Paul Holzinger <[email protected]>
base_hosts_file can be used to overwrite the default base host file /etc/hosts which is used to copy hosts entries from this file into the containers /etc/hosts file. As special value "image" can be used to copy the entries from the image hosts file or an empty string "" to not use a base file at all. Ref containers/podman#13277 Ref containers/podman#13748 Signed-off-by: Paul Holzinger <[email protected]>
base_hosts_file can be used to overwrite the default base host file /etc/hosts which is used to copy hosts entries from this file into the containers /etc/hosts file. As special value "image" can be used to copy the entries from the image hosts file or an empty string "" to not use a base file at all. Ref containers/podman#13277 Ref containers/podman#13748 Signed-off-by: Paul Holzinger <[email protected]>
base_hosts_file can be used to overwrite the default base host file /etc/hosts which is used to copy hosts entries from this file into the containers /etc/hosts file. As special value "image" can be used to copy the entries from the image hosts file or "none" to not use a base file at all. IF the value is empty we should use /etc/hosts as default. Ref containers/podman#13277 Ref containers/podman#13748 Signed-off-by: Paul Holzinger <[email protected]>
base_hosts_file can be used to overwrite the default base host file /etc/hosts which is used to copy hosts entries from this file into the containers /etc/hosts file. As special value "image" can be used to copy the entries from the image hosts file or "none" to not use a base file at all. IF the value is empty we should use /etc/hosts as default. Ref containers/podman#13277 Ref containers/podman#13748 Signed-off-by: Paul Holzinger <[email protected]>
base_hosts_file can be used to overwrite the default base host file /etc/hosts which is used to copy hosts entries from this file into the containers /etc/hosts file. As special value "image" can be used to copy the entries from the image hosts file or "none" to not use a base file at all. IF the value is empty we should use /etc/hosts as default. Ref containers/podman#13277 Ref containers/podman#13748 Signed-off-by: Paul Holzinger <[email protected]>
base_hosts_file can be used to overwrite the default base host file /etc/hosts which is used to copy hosts entries from this file into the containers /etc/hosts file. As special value "image" can be used to copy the entries from the image hosts file or "none" to not use a base file at all. IF the value is empty we should use /etc/hosts as default. Ref containers/podman#13277 Ref containers/podman#13748 Signed-off-by: Paul Holzinger <[email protected]>
base_hosts_file can be used to overwrite the default base host file /etc/hosts which is used to copy hosts entries from this file into the containers /etc/hosts file. As special value "image" can be used to copy the entries from the image hosts file or "none" to not use a base file at all. IF the value is empty we should use /etc/hosts as default. Ref containers/podman#13277 Ref containers/podman#13748 Signed-off-by: Paul Holzinger <[email protected]>
base_hosts_file can be used to overwrite the default base host file /etc/hosts which is used to copy hosts entries from this file into the containers /etc/hosts file. As special value "image" can be used to copy the entries from the image hosts file or "none" to not use a base file at all. IF the value is empty we should use /etc/hosts as default. Ref containers/podman#13277 Ref containers/podman#13748 Signed-off-by: Paul Holzinger <[email protected]>
@mheon WDYT making containers created via the docker compat api default to no base host file to better match docker? |
Ehhh. Is it worth the extra complexity? We've heard very few complaints about this... |
I agree with Matt, I am not sure this is worth the complexity. |
I don't think it is complex, it is a simple change once a cli option for base_hosts_file config option is added. #13277 But if you think we should not do this then close the issue as wontfix. The workaround is to set base_hosts_file in containers.conf (added in v4.1) |
Lets talk at standup. |
We agreed to add an option for this behaviour and to make it default for the Docker API. |
A friendly reminder that this issue had no activity for 30 days. |
@Luap99 any update? |
For me this issue is fixed with the 4.1.0 release and the included Line 37 in cab9779
|
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Unlike Docker, podman adds the
/etc/hosts
host entries to the/etc/hosts
containerSteps to reproduce the issue:
/etc/hosts
file with the following content:Describe the results you received:
Describe the results you expected:
I expect podman to behave like docker. Entry
127.0.0.1 foo
should not be in the container run by podman.Additional information you deem important (e.g. issue happens only occasionally):
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? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: