Closed bugthing closed 1 year ago
Note that this image is in progress to be moved to the upstream project: https://github.com/containers/toolbox/tree/main/images/arch
And generally, it's better to figure out if this is something that belongs upstream with Archs /etc/nsswitch.conf
instead of patching it inn the container image.
Quickly looking at it, it seems like resolve [!UNAVAIL=return]
does the wrong thing as a podman container. In my case it queries the host resolved
DNS service.
[fox@toolbox ~]$ ping -c 1 toolbox ^C [fox@toolbox ~]$ ping -c 1 framework # this is the container hosts hostname PING framework(framework (fe80::d0ee:adf2:2db:6d5b%wlp170s0)) 56 data bytes 64 bytes from framework (fe80::d0ee:adf2:2db:6d5b%wlp170s0): icmp_seq=1 ttl=64 time=0.035 ms --- framework ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.035/0.035/0.035/0.000 ms
Poking upstream systemd about this. The recommended upstream file seems incompatible with how toolbox
is actually mounting the resolved file into the container.
https://github.com/systemd/systemd/blob/main/factory/etc/nsswitch.conf
# Arch hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns # Fedora hosts: files myhostname mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns
thanks for looking at this @Foxboron @travier Happy to close this PR .. or leave open for tracking, but yeah, best to be addressed upstream if poss :smile:
I ran into an issue using this image and distrobox. When I created a new container it could not reference itself by its hostname.
I found that if I moved
myhostname
directive it could do so. This PR tweaks the nsswitch.conf file so that myhostname is further to the start of the hosts: line