-
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
hosts file not populated when using user namespace #7490
Comments
@st1971 thanks for the issue report. A couple of questions. If you run this same image as root, does it have an /etc/hosts file? Also, can you share how you created the container image initially? Depending on the build options, this might be expected. |
@TomSweeneyRedHat Thank you for taking a look, much appreciated. This is happening only as root and i am using a vanilla fedora:32 image pulled from registry.fedoraproject.org. Both of the below are run as root.. With --uidmap
Without --uidmap
Also get the same with a stock alpine image from docker.io. |
Suspicion: This is due to Generally speaking, Podman configures the network namespace completely, then creates any files it needs to bind-mount in ( We can probably edit |
A friendly reminder that this issue had no activity for 30 days. |
We do not populate the hostname field with the IP Address when running within a user namespace. Fixes containers#7490 Signed-off-by: Daniel J Walsh <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
when running a rooted container with either --uidmap or --subuidname /etc/hosts does not have an entry for the container.
Steps to reproduce the issue:
sudo podman run --rm -it --uidmap=0:100000:5000 --hostname=mycontainer fedora:32 /bin/bash -c "cat /etc/hosts"
Describe the results you received:
Output of the content of /etc/hosts without an entry for mycontainer
Describe the results you expected:
Output of the content of /etc/hosts with an entry for mycontainer, as you get without the --uidmap or --subuidname flag
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?
Yes
Have tested with 2.0.4 & 2.0.5
Additional environment details (AWS, VirtualBox, physical, etc.):
Physical server
The text was updated successfully, but these errors were encountered: