Skip to content

Adds another bootc example to documentation #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

djach7
Copy link
Contributor

@djach7 djach7 commented May 28, 2025

Follow up to #95.

  • Adds another bootc example to documentation, this time using quay and including the steps to update a booted system.
  • Fixes filesystem misrepresentation. Filesystem is now correctly stated as ext4

Copy link
Member

@nullr0ute nullr0ute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine from a quick read


This example walks through building and booting a Fedora IoT bootc image in a Podman machine.

To start, create a clone of the https://gitlab.com/fedora/bootc/base-images[Fedora Bootc Base Images] Git repository. This includes the Fedora
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking out the git repo shouldn't be necessary; the manifests should be embedded in the builder container image below. (Which needs to be changed...)

Comment on lines +9 to +19
----
FROM localhost/fedora-bootc as builder
RUN /usr/libexec/bootc-base-imagectl build-rootfs --manifest=fedora-iot /target-rootfs

FROM scratch
COPY --from=builder /target-rootfs/ /
LABEL containers.bootc 1
ENV container=oci
STOPSIGNAL SIGRTMIN+3
CMD ["/sbin/init"]
----
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a note above this to the effect of "This example is based on the Fedora bootc documentation about building scratch images; reference the upstream docs here for the latest version/information"

https://docs.fedoraproject.org/en-US/bootc/building-from-scratch/#_using_bootc_base_imagectl_build_rootfs

I had to swap out the builder image to use the images in the fedora-testing org on Quay; my Containerfile looks like:

FROM quay.io/fedora-testing/fedora-bootc:rawhide-standard as builder
RUN /usr/libexec/bootc-base-imagectl build-rootfs --manifest=fedora-iot /target-rootfs

FROM scratch
COPY --from=builder /target-rootfs/ /
RUN bootc container lint

LABEL containers.bootc 1
LABEL ostree.bootable 1
STOPSIGNAL SIGRTMIN+3
CMD ["/sbin/init"]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be another note about using fedora-testing here...

Ideally, we should be able to use quay.io/fedora/fedora-bootc:latest, but that image on the registry is missing the /usr/libexec/bootc-base-imagectl command.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So did you circumvent building fedora-bootc entirely then? This is your Containerfile for the iot image right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I just saw your comment below, I think that answers my question

Comment on lines +5 to +22
This example walks through building and booting a Fedora IoT bootc image using Quay.io, as well as pushing an update to a booted
Fedora IoT system.

To start, clone the https://gitlab.com/fedora/bootc/base-images[Fedora Bootc Base Images] Git repository. This includes the Fedora
IoT package manifest we will use to create our Fedora IoT bootc image.

Within this clone, create a `Containerfile.custom` with the following contents:
----
FROM localhost/fedora-bootc as builder
RUN /usr/libexec/bootc-base-imagectl build-rootfs --manifest=fedora-iot /target-rootfs

FROM scratch
COPY --from=builder /target-rootfs/ /
LABEL containers.bootc 1
ENV container=oci
STOPSIGNAL SIGRTMIN+3
CMD ["/sbin/init"]
----
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comment on the fedora-iot-bootc-pmachine-example.adoc file about changes that should be made here as well

CMD ["/sbin/init"]
----

Next, build a `localhost/fedora-bootc` image using the command below. This is required for building your Fedora IoT bootc image, as the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the builder image is changed as suggested, you don't need to build your own builder image, so you can drop some of these steps...

(I realized this after commenting about the sudo command)


Now, boot your Fedora IoT bootc image. Open a new terminal window and run:
----
podman-bootc run --filesystem=ext4 quay.io/[repository name]:fedora-iot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe that podman-bootc is packaged in Fedora...

You may want to link to the upstream repo where the install instructions are or change this section to cover building a disk image with bootc-image-builder and provisioning a VM

Copy link
Member

@miabbott miabbott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should align our guide to the bootc docs, so I would like to see some changes made

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants