-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Description
Description
In the rootless context docker does not follow symlinks from /var/run to /run.
When /etc/resolv.conf is linked to /var/run/netconfig/resolv.conf, and a link exists from /var/run to /run, DNS resolution fails in the rootless context. It uses the slirip4netns fallback nameserver running on 10.0.2.3.
It works fully well with the default context (daemon running as root), and with /etc/resolv.conf linked to /run/netconfig/resolv.conf in rootless.
The most likely source of the /var/run/netconfig/resolv.conf symlink is that my server was upgraded from SLES 12 to SLES 15 some years go.
If anyone stumbles upon this: try linking your /etc/resolv.conf to /run/netconfig/resolv.conf:
ln -s /run/netconfig/resolv.conf /etc/resolv.conf
Reproduce
- sudo rm /etc/resolv.conf
- ln -s /var/run/netconfig/resolv.conf /etc/resolv.conf
- docker pull
or docker login registry.example.com
- you will get a timeout since registry.example.com cannot be resolved by slirp4netns local dns
Expected behavior
dns resolution should work fine when /var is linked to /run
docker version
client 28.5.1-ce
api 1.51
go 1.24.10
containerd 1.7.29
runc 1.3.4
slirp4netns 1.2.2docker info
Unfortunately I cannot post this, since the bug happened on my company machineAdditional Info
No response