docker / docker/docker-ce-packaging

Debian 13 Trixie DNS Resolution failure - empty container resolv.conf upon restart with host using DHCP

Open
#1,317 4 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Makefile
Stars
209
Forks
164
Avg merge
2h 24m
Merged PRs (30d)
4

Description

I've been trying to debug an issue I'm having on fresh Debian 13 Trixie installs (I've not noticed it on upgrade). Having installed Docker via the official Docker repository as outlined in the instructions, I then set up some compose stacks with containers using unless-stopped for restart. My docker host uses DHCP and successfully connects, but it appears the Docker Engine is grabbing the host's /etc/resolv.conf too early. Looking in the container, I see this:

# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.


# Based on host file: '/etc/resolv.conf'
# Overrides: []

If I, however, restart the container once the host is up, this populates as expected and I have no DNS resolution issues. I see a thread about the exact problem on the Docker forums and a note there suggesting an issue be opened against the packaging repository for it. I didn't see such an issue already (if I missed it, I apologize), so I am creating this one for the issue. I can easily recreate the issue at-will, so can capture thinks or try tweaks as others may suggest.

Looking at my system journal, I do indeed see docker starting up before dhcpd assigned an IP and DNS addresses with it.

May 01 22:03:01 docker3 systemd[1]: Started docker.service - Docker Application Container Engine.
May 01 22:03:01 docker3 systemd[1]: Reached target multi-user.target - Multi-User System.
May 01 22:03:01 docker3 systemd[1]: Reached target graphical.target - Graphical Interface.
May 01 22:03:01 docker3 systemd[1]: Startup finished in 1.569s (kernel) + 4.942s (userspace) = 6.511s.
...
May 01 22:03:04 docker3 ifup[650]: ens18: leased ##snipped## for 86400 seconds

For the time being, I used the suggested wait service to force a few second delay (I had to add the wait service to docker.service) so that it comes up after dhcpd has done its work.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the system journal and Docker service startup configuration, comparing Docker startup with DHCP completion on a fresh Debian 13 install. Reproduce the reboot, inspect the container's generated resolv.conf, and confirm that DNS entries are populated without manually restarting the container or adding a wait service.

Written by the indexing model from the issue text.

Assessment

Tech stack
debian, docker
Domain
devops, infrastructure, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.