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

hostname is not added to /etc/hosts with network mode ‘none’ #8095

Closed
srcshelton opened this issue Oct 21, 2020 · 3 comments · Fixed by #8101 or #8347
Closed

hostname is not added to /etc/hosts with network mode ‘none’ #8095

srcshelton opened this issue Oct 21, 2020 · 3 comments · Fixed by #8101 or #8347
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@srcshelton
Copy link
Contributor

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Following on (hopefully for the last time!) from #8054, there’s potentially one last remaining use-case: if an image is launched with —network none for isolation purposes, the container hostname isn’t written to /etc/hosts and so certain applications (such as Java) which require this report that they can’t detect their own hostname.

It’s definitely an edge-case, since without networking the container can’t do much with the hostname it detects, and it’s arguably a Java issue for attempting to over-validate the hostname it’s given - but is there a case to write the container hostname to /etc/hosts even without networking, for the sake of completeness as much as anything?

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

Yes - with patch from #8054

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 21, 2020
@mheon mheon self-assigned this Oct 21, 2020
@mheon
Copy link
Member

mheon commented Oct 21, 2020

I'll take this

@mheon
Copy link
Member

mheon commented Oct 21, 2020

The current behaviour matches Docker, which does not modify /etc/hosts with --net=none. I'm not opposed to adding our hostname in this case, though.

mheon added a commit to mheon/libpod that referenced this issue Oct 21, 2020
This does not match Docker, which does not add hostname in this
case, but it seems harmless enough.

Fixes containers#8095

Signed-off-by: Matthew Heon <[email protected]>
@edsantiago
Copy link
Member

Turns out, #8101 didn't actually address this. Reopening.

@edsantiago edsantiago reopened this Nov 12, 2020
rhatdan added a commit to rhatdan/podman that referenced this issue Nov 16, 2020
The --hostname and containername should always be added to containers.

Added some tests to make sure you can always ping the hostname and container
name from within the container.

Fixes: containers#8095

Signed-off-by: Daniel J Walsh <[email protected]>
@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 Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
4 participants