Skip to content

Start container with repos support for legacy ISO only [HMS-11156] - #2582

Open
achilleas-k wants to merge 8 commits into
osbuild:mainfrom
achilleas-k:bootc-podman-restrict
Open

Start container with repos support for legacy ISO only [HMS-11156]#2582
achilleas-k wants to merge 8 commits into
osbuild:mainfrom
achilleas-k:bootc-podman-restrict

Conversation

@achilleas-k

Copy link
Copy Markdown
Member

When generating the manifest for the legacy anaconda ISO, start the container (or the build container, when different from the base) with repos support, meaning it has network access and the secrets are bind mounted from the host. In all other cases, we now start the container with no network and without explicitly bind mounting /run/secrets/. Note that secrets are still implicitly bind mounted by podman in its default configuration when running image-builder or bootc-image-builder outside a container.

This package was emptied out a while ago but somehow these two files
survived the move.
No need for a boolean to track if a separate build container has been
started.  Only define the deferred stopping in the same place where we
start it.
Import pkg/distro/bootc as bootcdistro and pkg/bootc as bootc.
It's much nicer than importing bootc as podman_container.
Rename the property to storeOpts (store options) since that's the only
thing they're used for.
@achilleas-k
achilleas-k requested a review from a team as a code owner August 5, 2026 22:58
We don't always need network access and secrets when running the
container.  In fact, we only need those two things in one case, when
initialising the dnf repo configs to build an anaconda-iso.

Split the container initialiser into two variants.  The default,
NewContainer(), starts the container without networking and without
bind mounting secrets explicitly.  Secrets are still bind mounted
implicitly by podman if running outside a container.
A second initialiser, NewContainerWithRepos(), works like the previous
initialiser did, which uses host networking and explicitly bind mounts
secrets.

Now we can limit the permissions of the container such that it only has
network and secrets access when needed.
When generating the manifest for the legacy anaconda ISO, start the
container (or the build container, when different from the base) with
repos support, meaning it has network access and the secrets are bind
mounted from the host.
@achilleas-k
achilleas-k force-pushed the bootc-podman-restrict branch from 826f53b to b41353a Compare August 5, 2026 23:01
@achilleas-k

Copy link
Copy Markdown
Member Author

We don't test with RHEL bootc containers in CI, but I did a lot of manual local testing for this. No manifests were affected by the change. Testing included:

  • CentOS bootc disk images and installers.
  • CentOS bootc disk images and installers with separate build containers.
  • Same as above with RHEL containers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant