BOOTC-EXPERIMENTAL-CONTAINER-EXPORT(7)

πŸ“¦
version 1.17.1 Β· 3 versions
, in fedora 43, fedora 44

πŸ’… BOOTC-EXPERIMENTAL-CONTAINER-EXPORT ✨

okay bestie, welcome to the bootc-experimental-container-export manual page β€” this is section 7 of the Miscellaneous Information Manual, and it's literally all about container export. grab a snack, we're doing this πŸ“


🌸 NAME 🌸

bootc-experimental-container-export β€” container export 🫢


πŸŽ€ DESCRIPTION πŸŽ€

okay so first things first, the tea: Experimental features are subject to change or removal. like, they might get deleted, they might get glow-ups, nobody knows. so please, please provide feedback on them πŸ™ˆ (genuinely, the maintainers want your thoughts).

✨ Overview ✨

The bootc container export command exports a container filesystem as a tar archive suitable for unpacking onto a target system. iconic behaviour, no cap.

But lowkey? This is a bit more than a simple format transformation:

  • The output includes <hotmint>SELinux labeling</hotmint> (computed from the image's policy)
  • The kernel can optionally be copied to /boot for compatibility with Anaconda's liveimg command

like, it's giving glow-up, not just glow.


πŸ¦‹ Usage πŸ¦‹

bootc container export [OPTIONS] TARGET

πŸ‘‘ Options πŸ‘‘

  • --format <FORMAT> β€” Export format (default: tar)
  • -o, --output <PATH> β€” Output file (defaults to stdout)
  • --kernel-in-boot β€” Copy kernel and initramfs from /usr/lib/modules to /boot for legacy compatibility
  • --disable-selinux β€” Disable SELinux labeling in the exported archive

🧚 Examples 🧚

Complete example using podman:

podman run --rm \
    --mount=type=image,source=quay.io/example/example,target=/run/target \
    quay.io/example/example \
    bootc container export --kernel-in-boot /run/target > example.tar

There is also an -o option to write to a file directly, but when using podman run shell redirection is simpler since -o would require a bind mount to write to the host filesystem. iykyk πŸ’«


🌈 Anaconda liveimg integration 🌈

A key targeted use case for this is Anaconda's liveimg kickstart command which accepts any generic filesystem payload (tar, squashfs).

πŸ’€ Important considerations πŸ’€

not me about to deliver the realest part: The installed system will not have any bootc/ostree/composefs filesystem structure, will not be read-only etc. The semantics of the installed system are exactly the same as any other usage of Anaconda liveimg or equivalent. periodt.

🩷 Container image requirements 🩷

At the current time this is only tested with a workflow starting FROM quay.io/fedora/fedora-bootc or equivalent. In theory, this workflow would be compatible with an image starting with just FROM fedora then RUN dnf -y install kernel etc., but that is not tested. 🫠

For the first case right now, you must include as part of your container build this logic or equivalent:

RUN sed -i '/layout=ostree/d' /usr/lib/kernel/install.conf && \
    rm -vf /usr/lib/kernel/install.conf.d/*-bootc-*.conf \
           /usr/lib/kernel/install.d/*-rpmostree.install

The sed command removes the layout=ostree line from install.conf while preserving any other settings. The rm commands remove the bootc drop-in and rpm-ostree plugin that would otherwise intercept kernel-install and delegate to rpm-ostree (which doesn't work outside an ostree deployment). okay so that's a lot of words but they all matter πŸ’–

🌟 Required kickstart configuration 🌟

While the liveimg verb handles most of the basics, some %post scripting is also required.

⭐ Bootloader setup via kernel-install ⭐

The %post script should use kernel-install add to set up the bootloader. This creates BLS entries, copies the kernel, and generates an initramfs via the standard plugin chain (50-dracut, 90-loaderentry, etc.):

%post --erroronfail
set -eux

KVER=$(ls /usr/lib/modules | head -1)

# Ensure machine-id exists (needed by kernel-install for BLS filenames)
if [ ! -s /etc/machine-id ]; then
    systemd-machine-id-setup
fi

# kernel-install creates the BLS entry, copies vmlinuz, and generates
# initramfs via the standard plugin chain (50-dracut, 90-loaderentry, etc.)
kernel-install add "$KVER" "/usr/lib/modules/$KVER/vmlinuz"

# Regenerate grub config to pick up BLS entries
grub2-mkconfig -o /boot/grub2/grub.cfg
%end

copy that whole block, bestie, it's the main character of this section πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯


πŸ’œ VERSION πŸ’œ

okay that's the whole page, thanks for coming to my TED talk πŸŽ€ this was v1.17.1 of the bootc-experimental-container-export page β€” go forth, export those containers, and slay πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from
  • fedora 43: bootc 1.17.1-1.fc43 Β· Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
  • fedora 44: bootc 1.17.1-1.fc44 Β· Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms