Skip to content

docs: add guidance about resolv.conf - #2450

Merged
cgwalters merged 1 commit into
bootc-dev:mainfrom
jmarrero:resolv
Sep 14, 2026
Merged

cgwalters merged 1 commit into
bootc-dev:mainfrom
jmarrero:resolv

Conversation

@jmarrero

@jmarrero jmarrero commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Users keep copying the /etc/resolv.conf they see during a container
build into the image, or hitting a dangling resolver symlink after
install, because the file a container runtime bind-mounts during
RUN is not the booted host's configuration. Document the one thing
bootc does about it -- removing a zero-length /etc/resolv.conf and
/etc/hostname left by the runtime at import -- and point at the
network stack (NetworkManager, systemd-resolved) for everything else,
including static DNS. If a file really has to ship in the image, keep
/etc/resolv.conf a tmpfiles.d symlink to content under /usr, since a
regular file in /etc sticks across upgrades.

@github-actions github-actions Bot added the area/documentation Updates to the documentation label Sep 10, 2026
@bootc-bot
bootc-bot Bot requested a review from cgwalters September 10, 2026 19:04
Comment thread docs/src/building/dns.md
Comment thread docs/src/building/dns.md Outdated
Comment thread docs/src/building/dns.md Outdated
Comment thread docs/src/building/dns.md Outdated
Comment thread docs/src/building/dns.md Outdated
Comment thread docs/src/building/dns.md Outdated
Comment thread docs/src/building/dns.md Outdated
Users keep copying the /etc/resolv.conf they see during a container
build into the image, or hitting a dangling resolver symlink after
install, because the file a container runtime bind-mounts during
`RUN` is not the booted host's configuration.  Document the one thing
bootc does about it -- removing a zero-length /etc/resolv.conf and
/etc/hostname left by the runtime at import -- and point at the
network stack (NetworkManager, systemd-resolved) for everything else,
including static DNS.  If a file really has to ship in the image, keep
/etc/resolv.conf a tmpfiles.d symlink to content under /usr, since a
regular file in /etc sticks across upgrades.

Assisted-by: AI
Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com>
@jmarrero
jmarrero marked this pull request as ready for review September 14, 2026 18:24
@bootc-bot
bootc-bot Bot requested a review from cgwalters September 14, 2026 18:25
@jmarrero

Copy link
Copy Markdown
Contributor Author

I got Claude Code with Fable 5.1 to also verify each example by creating containers and verifying with BCVK.

Comment thread docs/src/building/dns.md

For Fedora-derived images, removing the `systemd-resolved` package is generally
clearer than only disabling its service: the package also owns the tmpfiles
rule that creates the symlink. Do the removal in a `RUN --network=none` step:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah though at some point it's cleaner to do a "from scratch" style build for this stuff.

@cgwalters
cgwalters enabled auto-merge (rebase) September 14, 2026 18:39
@cgwalters
cgwalters merged commit 7d74475 into bootc-dev:main Sep 14, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Updates to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants