Skip to content

rootless does not follow symlink to /run/netconfig/resolv.conf #52035

@TragiWritesCode

Description

@TragiWritesCode

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

  1. sudo rm /etc/resolv.conf
  2. ln -s /var/run/netconfig/resolv.conf /etc/resolv.conf
  3. docker pull or docker login registry.example.com
  4. 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.2

docker info

Unfortunately I cannot post this, since the bug happened on my company machine

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/rootlessRootless Modekind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.status/0-triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions