Skip to content

Add image_to_install cli option - #314

Open
Johan-Liebert1 wants to merge 6 commits into
bootc-dev:mainfrom
Johan-Liebert1:img-to-install-cli-opt
Open

Add image_to_install cli option#314
Johan-Liebert1 wants to merge 6 commits into
bootc-dev:mainfrom
Johan-Liebert1:img-to-install-cli-opt

Conversation

@Johan-Liebert1

@Johan-Liebert1 Johan-Liebert1 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

We bind mount host container storage into an ephemeral VM in order to
create a base disk. This has the unfortunate effect of changing the
manifest digest of the final image.

#313 tried to address this by
first exporting to OCI dir, then installing, but that too changes the
final manifest digest.

With the image_to_install option, we can pass docker://quay.io/...
as the image to be installed which will have the correct manifest digest
as we are pulling directly from the registry.

Also, we might need networking to pull an image from a registry, so we
pass --net=host to the podman command if the transport is registry

We do depend on skopeo with this change as we can't use podman to query
remote registry image manifests

Fixes: #307

We bind mount host container storage into an ephemeral VM in order to
create a base disk. This has the unfortunate effect of changing the
manifest digest of the final image.

bootc-dev#313 tried to address this by
first exporting to OCI dir, then installing, but that too changes the
final manifest digest.

With the `image_to_install` option, we can pass `docker://quay.io/...`
as the image to be installed which will have the correct manifest digest
as we are pulling directly from the registry.

Also, we might need networking to pull an image from a registry, so we
pass `--net=host` to the podman command if the transport is registry

We do depend on skopeo with this change as we can't use podman to query
remote registry image manifests

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
@Johan-Liebert1
Johan-Liebert1 force-pushed the img-to-install-cli-opt branch from 6e9f5f1 to 5a9f1eb Compare August 13, 2026 11:23
@Johan-Liebert1

Copy link
Copy Markdown
Contributor Author

Tests running into some user ns issue on Github CI. Possibly something to do with skopeo interaction with containers storage

Comment thread crates/kit/src/to_disk.rs
Comment thread crates/kit/src/to_disk.rs
let image_to_install = opts
.image_to_install
.as_ref()
.unwrap_or(&opts.source_image)

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.

When --composefs-backend is used without --image-to-install, the source falls back to containers-storage: which still produces the wrong manifest digest

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Which is okay I think, as we use the image for upgrade op anyway. This is for a niche use case in bink CI

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.

Fair. Would be nice have some warning when --composefs-backend is set without --image-to-install but it's not a blocker.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I guess the cli opt wasn't required after all, see #307 (comment)

I still think the option is a pretty good addition, and with this I don't think we need a warning

Comment thread crates/kit/src/to_disk.rs Outdated
@gursewak1997

Copy link
Copy Markdown
Collaborator

Every test_to_base_disk_* test fails with Invalid transport: quay.io/centos-bootc/centos-bootc. The issue is that --source-imgref is now passed unconditionally, but without --image-to-install the fallback image name has no transport prefix (e.g., containers-storage: or docker://).

@Johan-Liebert1
Johan-Liebert1 force-pushed the img-to-install-cli-opt branch 5 times, most recently from df4552c to 2f36cef Compare August 17, 2026 10:38
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Was using for the `Transport` enum, but it has some linux specific
functions which breaks MacOs builds

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
skopeo inspect requires unshare which fails in unprivileged CI
environments. For local images (from containers-storage), use
podman image inspect instead, and only fall back to skopeo
for remote transports like docker://

Also, fix `libvirt to-disk` command by making sure image has a transport
attached to it as now we're passing `--source-imgref` to bootc install

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
@cgwalters

Copy link
Copy Markdown
Collaborator

With the image_to_install option, we can pass docker://quay.io/...
as the image to be installed which will have the correct manifest digest
as we are pulling directly from the registry.

I don't think we should justify this change because of digests. Again, this is something to fix in bootc.

That aside, yes we should make it easier to support --source-imgref testing in bcvk. But as far as I can think of there's really no strong reason to use it other than CI testing simulating anaconda-style installs.

(And rather than simulating we should make it easier to actually do anaconda installs w/bcvk I think)

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.

[composefs-backend]: Install to-disk produces incorrect manifest digest

3 participants