Description of problem:
With recent podman update to podman-3:3.2.0-5.fc34.x86_64 I've noticed broken networking in the container in form of /etc/hosts containing IP address that's not reachable by the container itself but it's associated to the hostname of the container.
Version-Release number of selected component (if applicable):
podman-3:3.2.0-5.fc34.x86_64
How reproducible:
always
Steps to Reproduce:
1. podman run --rm -it registry.fedoraproject.org/fedora:34 cat /etc/hosts
Actual results:
$ podman run --rm -it registry.fedoraproject.org/fedora:34 cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
# used by slirp4netns
10.0.2.2 9157f08f6462 hardcore_yalow
10.0.2.2 host.containers.internal
Expected results:
$ podman run --rm -it registry.fedoraproject.org/fedora:34 cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
# used by slirp4netns
10.0.2.100 9157f08f6462 hardcore_yalow
Additional info:
When checking the ip address of the container, it's 10.0.2.100 so this is the value that should be in /etc/hosts.
This breaks so many things like python detection of the IP address: socket.gethostbyname(socket.gethostname())