docs: add guidance about resolv.conf - #2450
Merged
Merged
Conversation
cgwalters
requested changes
Sep 10, 2026
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>
Contributor
Author
|
I got Claude Code with Fable 5.1 to also verify each example by creating containers and verifying with BCVK. |
cgwalters
approved these changes
Sep 14, 2026
|
|
||
| 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: |
Collaborator
There was a problem hiding this comment.
Yeah though at some point it's cleaner to do a "from scratch" style build for this stuff.
cgwalters
enabled auto-merge (rebase)
September 14, 2026 18:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
RUNis not the booted host's configuration. Document the one thingbootc 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.