Going forward in the bootc world, I’d like to see something like this:
Layer 0: Really Minimal
FROM fedora:rawhide AS helper
RUN dnf install --installroot /var/tmp/installroot --use-host-config --setopt install_weak_deps=false -y filesystem \
&& dnf --installroot /var/tmp/installroot clean all
FROM scratch AS ring0
COPY --from=helper /var/tmp/installroot/. /
4.19 mb. Just as tiny as we can make it, while still being nominally Fedora. [1]
This is kind of frivolous, but it provides a starting point and a pattern for other (presumably more useful) minimal containers).
Layer 1: add DNF
FROM fedora:rawhide AS helper
COPY --from=localhost/fedora/ring0:rawhide /. /var/tmp/installroot
RUN dnf install --installroot /var/tmp/installroot --use-host-config --setopt install_weak_deps=false -y dnf \
&& dnf --installroot /var/tmp/installroot clean all
FROM scratch AS ring1
COPY --from=helper /var/tmp/installroot/. /
92 mb. For the convenience of having DNF in the image, so you don’t have to do the helper pattern thing.
Layer 2: Make it Bootable
FROM localhost/fedora/ring1:rawhide
RUN dnf install --setopt install_weak_deps=false -y kernel-core selinux-policy-targeted bootc \
&& dnf clean all
LABEL containers.bootc 1
419 mb. Contains useful stuff like systemd and podman, too. (And selinux — it’d be 393 mb without that.) At this stage, we’d do whatever magic is necessary to make this into a bootc base container.[2]
Layer 3: Common Consensus Core
FROM localhost/fedora/ring2:rawhide
RUN dnf install --setopt install_weak_deps=false -y [whatever we agree on] \
&& dnf clean all
LABEL containers.bootc 1
The rule for this layer is simple: it contains all packages that every Fedora Edition has in common, and no packages that aren’t in every edition. That is, every Edition gets veto power.[3] Not in a hostile way — the intention is completely the opposite: there’s no need to debate or vote or anything like that.
Above That…
Each Edition would start with FROM fedora/ring3
and add in what they need.
Ideally, we would have more shared layers at this level too — like graphics stack support, shared by all of the desktop environments. (And sound. fedora/desktop-common
or something.)
So…
Part of the problem with minimization and standardization previously is that we didn’t have a clear definition for what “minimal” or “base” really meant.[4] With this, we have a clear target, and can focus on the lower layers for:
- Minimization
- Testing
- Gating (if something breaks at a lower layer, it breaks everything!)
- Security review
These things can focus first on layer 0, and then move up as we have capacity and confidence.
These also provide more clear domain separation — if you’re working on a spin starting from layer 3, you should have confidence that everything up until there should just work, and be able to focus on your changes. On the other side, I can imagine a renewed “Base Working Group” with ownership of the lower layers.[5]
I notice that
fedora-gpg-keys
is taking up a relatively large amount of that; probably keys for releases more than the last three could be moved to a-old
subpackage. ↩︎The bootc project’s intention is to make the above just work, but currently there’s some complication. ↩︎
Non-Edition deliverables can start from this point as well, or if they want something more minimal, from Layer 2 instead. ↩︎
See Base - Fedora Project Wiki from a decade ago. ↩︎
I would expect that to also include members of Edition working groups who care about the end-to-end experience. ↩︎