Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
In image mode for RHEL, the operating system is a bootable container image (built FROM registry.redhat.io/rhel10/rhel-bootc). bootc runs on the installed system. bootc upgrade downloads a newer build of the image the system follows and stages it for the next boot; bootc switch makes the system follow another image; bootc rollback boots the previous image again.
/usr comes from the image and is read-only. /etc is kept and merged with the image's /etc at every update. /var is local data and is never changed by an update. To change the system, change the Containerfile and build a new image — not dnf install on the server. Disk images are made with bootc-image-builder (a container image).
Zo schrijf je het
bootc COMMAND [OPTION]...
bootc upgrade [--check | --apply]
bootc switch [OPTION]... IMAGEBelangrijkste delen
Commands
status- Show the booted, staged and rollback images.
upgrade- Download and stage a newer build of the current image.
switchIMAGE- Follow another image (another tag or repository).
rollback- Boot the previous image at the next reboot.
edit- Change the host settings (image, transport) in an editor or from a file.
usr-overlay- Make
/usrwritable with a temporary layer, until the next reboot. installto-diskDEVICE- Install the running container image to a disk (run inside the image with podman).
installto-filesystemDIR- Install into a mounted file system.
installto-existing-root- Replace the OS of an existing system with the image.
containerlint- Check a container image for problems (run in the build).
imagelist- List images in the bootc storage.
imagecopy-to-storage- Copy the booted image to the Podman storage.
Opties 21
Meest gebruikt
status
upgrade
switch
install (to-disk, to-filesystem)
Niets past bij dit filter.
Voorbeelden 11
$ als gewone gebruiker# als root (of met sudo)
1Show what the system runs
2Check for an update without changing anything
sudo bootc upgrade --check3Download an update, use it at the next reboot
4Update and reboot in one step
sudo bootc upgrade --apply5Follow another image (for example a new major tag)
6Go back after a bad update
The previous image boots again; /etc and /var keep their state.
7Turn automatic updates on or off
8Install a debug tool for a short test
The overlay is gone after the next reboot.
9Check the image in the build pipeline (DevSecOps)
10Make a qcow2 disk with bootc-image-builder
podman run --rm -it --privileged --pull=newer --security-opt label=type:unconfined_t -v ./config.toml:/config.toml:ro -v ./output:/output -v /var/lib/containers/storage:/var/lib/containers/storage registry.redhat.io/rhel10/bootc-image-builder:latest --type qcow2 quay.io/s0sta/web-bootc:1.0 ls output/qcow2/ disk.qcow211Install the image to a second disk from a running RHEL host
podman run --rm --privileged --pid=host -v /dev:/dev -v /var/lib/containers:/var/lib/containers --security-opt label=type:unconfined_t quay.io/s0sta/web-bootc:1.0 bootc install to-disk --wipe /dev/vdb
Niets past bij dit filter.
Let op
- Files put in
/varby the Containerfile are copied only at the first install; updates never change/var. dnf installon the running system fails (/usris read-only). Add packages to the Containerfile.- A rollback target exists only after the first upgrade or switch.
Bestanden
/usr- Read-only, from the image.
/etc- Local changes kept and merged with the image at updates.
/var- Local data, kept across updates and rollbacks.
/usr/lib/bootc/kargs.d/- Kernel arguments that come with the image.
Tips om te onthouden
- Follow a moving tag (
:prod) on servers; build fixed tags (:1.0,:1.1) in CI and move:prodwhen tests pass. - Sign images in CI and turn on
--enforce-container-sigpolicyso servers only boot signed images.
Exitcodes
0 | Success. |
1 | Error. |