Fedora IoT Bootc Example with Raspberry Pi
Using bootc
with Fedora IoT currently requires that you have already provisioned a device with Fedora IoT.
Follow the instructions in Physical Device Setup to provision Fedora IoT to your Raspberry Pi.
Once the Raspberry Pi is provisioned successfully, you can create a custom Fedora bootc
image.
Build a custom Fedora Bootc image and push it to a registry
To build your own image on your host you can create a Containerfile. This example just copies a file to /etc
.
this example uses the Fedora bootc base image and does not include all of the RPMs included as part of Fedora IoT.
|
FROM quay.io/fedora/fedora-bootc:latest
COPY files/secret /etc
To build and push the image with podman
run the following on the host:
podman build --platform linux/arm64 -t quay.io/username/bootc-test-image:latest
podman push quay.io/username/bootc-test-image:latest
This example uses Quay.io as the registry; you may need additional configuration to push to the registry you are using.
Switch the Raspberry Pi to your custom image
On the Raspberry Pi you can now switch to your custom image with the bootc switch
command.
bootc switch quay.io/username/bootc-test-image:latest
After rebooting the Raspberry Pi, the file copied as part of the Containerfile should be present in the filesystem:
cat /etc/secret
Want to help? Learn how to contribute to Fedora Docs ›