Repository navigation
Description
Logically bound images
Current documentation: https://bootc-dev.github.io/bootc/logically-bound-images.html
Original feature proposal text:
We should support a mechanism where some container images are "lifecycle bound" to the base bootc image.
A common advantage/disadvantage of the below is that the user must manage multiple container images for system installs - e.g. for a disconnected/offline install they must all be mirrored, not just one.
In this model, the app images would only be referenced from the base image as .image files or an equivalent.
This contrasts with physically bound images.
bootc logically bound flow
bootc upgrade follows a flow like:
- fetch new base image
- Read its root filesystem, discover logically bound images
- Pull those images into a new bootc-owned container storage (xref Introduce bootc-owned container store, use for bound images #724 )
- Garbage collect images which are not referenced by any root (e.g. pending/current/rollback).
Current design: symlink to .image or .container files
Introduce /usr/lib/bootc/bound-images.d that is symlinks to .image files or .container files.
Pros:
- Straightforward to implement
- The admin only needs to bump a
:sha256digest in one place to update
Cons:
- Handling systemd specifiers is tricky, we will error out on them
- No separation of concerns: an
.imagefile is intended to pull images not be parsed by an external tool for a separate purpose. - Updates to Quadlet may break the process and/or add (potential) continuous maintenance burden for bootc (i.e., "chasing/reimplementing new features").
- Forces users to use Quadlet even if they have no use for pulling images under systemd.
Note: we expect the .image files to reference images by digest or immutable tag. There is no mechanism to pull images out of band.
Other alternatives considered
New custom config file
A new TOML/usr/lib/bootc/bound-images.d, of the form e.g. 01-myimages.toml:
images = ["quay.io/testos/someimage@sha256:12345", "quay.io/testos/otherimage@sha256:54321"]
authfile = "/etc/containers/my-custom-auth.json"
Pros:
- Easy to just list multiple images vs one image per
.imagefile - TOML format is used by other bootc tooling and some of the container config formats
Cons:
- New file format relating to container images
- May need in the general case to support many of the existing options in
.imagefiles - The admin will need to bump a
:sha256digest in two places to update in general (both in a.containeror.imageand the custom.tomlhere)
Parse existing .image files
Pros:
- Well known
- Spec -> pull translation exists
- Existing spec handles most image pull fields
Cons:
- Would need to extend the spec to include a new
bootc=boundor equivalent opt-in - Handling specifiers is tricky
- Implentation complicated wrt managing systemd
What would happen under the covers here is that bootc would hook into podman and:
- disallow GC of these images even if the unit isn't running (for all deployments)
- Fetch new images (from the new base container image) on
bootc upgrade
TODO:
- docs
- CI test
- PR to fedora bootc examples
- Ensure compatibility with bootc-image-builder bound images fail in bootc-image-builder #715
- install path with
bootc install to-filesystem- simple scenario w/out pull secret? - install path w/pull secret embedded in bootc image? podman pull happens from bootc container
- install path w/bootc-image-builder where it pre-pulls images, demonstrated e2e w/konflux, we probably need to enable a model where bound images are provided in a mirror location or OCI directory
Activity
alexlarsson commentedon Oct 24, 2023
In the automotive world we often think of containers as two possible things. Either they come with the system, and are updated atomically with it, or they are separately installed. They way we expect this to work is for the system ones to be installed in a separate image store that is part of the ostree image. And then the "regular" containers will just be stored in /var/lib/container.
The automotive sig manifests ship a storage.conf that has:
Then we install containers in the image with osbuild like:
alexlarsson commentedon Oct 24, 2023
This was part of the driver for the need for composefs to be able to contain overlayfs base dirs (overlay nesting). Although that is less important if container/storage also uses composefs.
rhatdan commentedon Oct 30, 2023
I love the idea of additonal stores for this.
vrothberg commentedon Oct 30, 2023
Quadlet supports
.imagefiles now which can be directly referenced in.containerfiles. Maybe that's a way to achieve a similar effect.The
.imagefiles don't yet (easily) allow for pulling into an additional store, but this could be a useful feature.Cc: @ygalblum
cgwalters commentedon Oct 30, 2023
So IMO this issue is exactly about having
bootc installandbootc updatehandle these images. Because as is today, needing to duplicate the app images in an osbuild manifest is...unfortunate. With this proposal, when osbuild is making a disk image, it'd usebootc installinternally to the pipeline, and we wouldn't need to re-specify the child container images out of band of the "source of truth" of the parent image.alexlarsson commentedon Oct 31, 2023
I understand that, and I merely pointed out how we currently do it in automotive, not how it would be done with bootc.
Instead, what I propose is essentially:
Dockerfile:
my-app.container:
And then you have an osbuild manifest that just deploys the above image like any normal image.
Of course, instead of open-coding the commands like this, a tool could do the right thing automatically.
You might also want the tool to tweak the image name in the quadlet to contain the actual digest so we know that the exact right image version is used every time.
alexlarsson commentedon Oct 31, 2023
Its also interesting to reflect on the composefs efficiency in a setup like this.
If we use composefs for the final ostree image, we will get perfect content sharing, even if each of the individual additional-image-stores use its own composefs objects dir. Even if no effort is made to try to share object files between image store directories. Because all the files will eventually be deduplicated as part of the full ostree composefs image.
In fact, we will even deduplicate files between image stores that use the traditional overlayfs or vfs container store formats.
alexlarsson commentedon Oct 31, 2023
In fact, maybe using vfs backend is the right approach here? It is a highly stable on-disk format, and its going to be very efficient to start such a container. And we can ignore all the storage inefficiencies, because they are taken care off by the outer composefs image.
ygalblum commentedon Nov 1, 2023
Just wanted to note that
--storage-optis a global argument. So, the key to use isGlobalArgsinstead ofPodmanArgs.alexlarsson commentedon Nov 22, 2023
I wonder if we should tweak the base images to have a standardized /usr location for additional image store images.
rhatdan commentedon Nov 22, 2023
/usr/lib/containers/storage?
alexlarsson commentedon Nov 22, 2023
@rhatdan Yeah, that sounds good to me. Can we perhaps just add it alwas to our /usr/share/containers/storage.conf file?
rhatdan commentedon Nov 22, 2023
You want that in the default storage.conf in containers/storage?
rhatdan commentedon Nov 22, 2023
If you setup an empty additionalstore you need to precreate the directories and lock files. This is what we are doing to setup an empty AdditonalStore. We should fix this in containers/storage to create these files and directories if they do not exists.
27 remaining items
cgwalters commentedon Jul 16, 2024
IOW you want the image to be not experimental and maintained ~forever?
rhatdan commentedon Jul 16, 2024
I want the concept to be managed forever.
If RHEL AI uses it, We need it for the next X years.
If you change the format of the files, I don't care. but starting out with saying something is experimental in the RHEL world should be a non-starter.
cgwalters commentedon Jul 16, 2024
We're already shipping things classified as experimental (xref #690 ); I think it's an essential way to get feedback without committing to an interface immediately.
As far as stability, in theory we could allow usage of an experimental interface, but we just need to keep it around as long as the known consumers use it.
That all said, OK...the feature as is today is sufficiently small that perhaps it can just be stable to start for the next release.
rhatdan commentedon Jul 17, 2024
I don't care if you document something as experimental, but putting it into the file system, makes it difficult to transition, when it is no longer experiemental. I just want the directory renamed.
cgwalters commentedon Jul 23, 2024
This was changed in #714
cgwalters commentedon Jul 23, 2024
OK, the more I play with this the more I am coming to the conclusion it makes sense to put bound images in the "bootc storage". Which...doesn't yet exist, but should. I will write up a separate issue.
EDIT: done in #721
cgwalters commentedon Jul 25, 2024
So...an interesting semantic with logically bound images as they exist today (writing to the default shared
/var/lib/containers) is that by default if you're tracking a floating tag (e.g.:latest) for the image, each timebootc upgradeis invoked we will only re-fetch the tag when the base image changes.But...when that does happen, the updated bound image is immediately visible.
Some people will want to invoke e.g.
bootc upgradewithout rebooting just as a way to "pre-fetch" an upgrade. In that scenario, if you have logically bound images, if any container referencing them happens to restart, it will suddenly see the new image.It would hence feel more predictable to me if we made logically bound images default to only appearing in their referenced root. It is more likely that we can implement that on top of #721 but it's still quite nontrivial.
OTOH...as I said in some other place I can actually see it being quite useful for users to pre-update logically bound images (can I acronym as LBI? just here?) ok yes LBIs outside of the default host update lifecycle.
But if we go that path...it seems certainly far cleaner to offer an explicit
bootc image upgradeor so that explicitly doesn't touch the host, instead of just offeringbootc upgradewhich would do it via side effect?Or...of course alternatively,
bootc upgradecould check for all LBI updates (for versioned tags) even if the host image didn't change. That would feel more consistent too.cgwalters commentedon Jul 25, 2024
@ckyrouac opinions on ⬆️ ?
cgwalters commentedon Jul 25, 2024
Maybe we just for now strongly discourage floating tags for LBIs, and document the semantic that they will only update when the host changes.
cgwalters commentedon Jul 25, 2024
Something I also am realizing related to this is that
bootc upgrade --checkwon't give you any info for LBIs at all; i.e. we lose the ability to know how much data we'll download in advance at all. The users who choose to use this may not care...at first. But...this may argue for creating a build process that can ensure that the bootc base image's manifest can reference the LBIs at a metadata level.There's a lot of advantages to that, but it would be Hard to do in a Containerfile flow today without going all the way to something like FROM oci-archive.
ckyrouac commentedon Jul 25, 2024
I think this makes the most sense. I haven't had a chance to look closely at your draft PR to use an additional store for bound images, but this is how I expect it to work. e.g. when upgrading a bootc system that has a new bound-image, we would pull the bound-image into the staged root's storage. This seems to make the most sense if the additional store will be in /usr which is not supposed to change. Since we'll no longer be using the shared storage, I think we'll need to first check the booted root for the image and copy it to the staged root to avoid re-downloading it, or something to avoid re-downloading the image every upgrade.
That doesn't address the issue of how to handle floating tags though. I'm not really sure how we can make binding to
:latestbe predictable since it will depend on when an upgrade happens, or what was on the build system when a disk is created, etc. I think the best we could do is be clear in our docs how floating tags will behave, makebootc statusclearly show which version is booted/staged, maybe some lint checks to discourage using:latest(although there could be other floating tag names). I need to think about this more.cgwalters commentedon Aug 2, 2024
https://gitlab.com/fedora/bootc/examples/-/merge_requests/50
strugee commentedon Apr 9, 2025
Can someone update the link in the description to https://bootc-dev.github.io/bootc/logically-bound-images? Current one is dead