Skip to content

Commit afd3322

Browse files
authored
Merge pull request #103 from miabbott/rpi_fixup
asciidoc cleanups and RPi content reduction
2 parents f464f4d + ffe6229 commit afd3322

File tree

6 files changed

+107
-94
lines changed

6 files changed

+107
-94
lines changed

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ if uname | grep -iwq darwin; then
1515
elif uname | grep -iq linux; then
1616
# Running on Linux.
1717
# there isn't an antora/aarch64 container, antora can be installed locally
18-
# Check whether podman is available, else faill back to docker
18+
# Check whether podman is available, else fall back to docker
1919
# which requires root.
2020

2121
if [ -f /usr/local/bin/antora ]; then
2222
/usr/local/bin/antora "${cmd}"
2323
elif uname -m | grep -iwq aarch64; then
2424
echo "no antora/aarch64 container try just \`npm install -g @antora/cli @antora/site-generator-default\`"
25-
elif [ -f /usr/bin/podman ]; then
25+
elif command -v podman > /dev/null; then
2626
echo ""
2727
echo "This build script is using Podman to run the build in an isolated environment."
2828
echo ""

preview.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/sh
22

3-
if [ "$(uname)" = "Darwin" ]; then
3+
if uname | grep -iwq darwin; then
44
# Running on macOS.
55
# Let's assume that the user has the Docker CE installed
66
# which doesn't require a root password.
77
echo "The preview will be available at http://localhost:8080/"
88
docker run --rm -v "$(pwd):/antora:ro" -v "$(pwd)/nginx.conf:/etc/nginx/conf.d/default.conf:ro" -p 8080:80 nginx
99

10-
elif [ "$(expr substr "$(uname -s)" 1 5)" = "Linux" ]; then
10+
elif uname | grep -iq linux; then
1111
# Running on Linux.
1212
# Fedora Workstation has python3 installed as a default, so using that
1313
echo ""
Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
= Fedora IoT Bootc Image Example with Podman Machine
22

3-
This example walks through building and booting a Fedora IoT bootc image in a Podman machine.
3+
This example walks through building and booting a Fedora IoT `bootc` image in a Podman machine.
44

5-
NOTE: This example is based on the Fedora bootc documentation about building scratch images; reference the upstream docs
5+
NOTE: This example is based on the Fedora `bootc` documentation about building scratch images; reference the upstream docs
66
https://docs.fedoraproject.org/en-US/bootc/building-from-scratch/#_using_bootc_base_imagectl_build_rootfs[here] for the latest version/information.
77
88
To start, create a `Containerfile.custom` with the following contents:
9+
10+
[source,dockerfile]
911
----
1012
FROM quay.io/fedora-testing/fedora-bootc:rawhide-standard as builder
1113
RUN /usr/libexec/bootc-base-imagectl build-rootfs --manifest=fedora-iot /target-rootfs
@@ -18,37 +20,49 @@ STOPSIGNAL SIGRTMIN+3
1820
CMD ["/sbin/init"]
1921
----
2022
21-
Initialize your Podman machine using the following command. You may skip this step if you already have a podman machine.
23+
Initialize your Podman machine using the following command. You may skip this step if you already have a Podman machine.
24+
25+
[source,bash]
2226
----
2327
podman machine init
2428
----
2529
26-
Grant your Podman machine the permissions necessary to run your Fedora IoT bootc image using:
30+
Grant your Podman machine the permissions necessary to run your Fedora IoT `bootc` image using:
31+
32+
[source,bash]
2733
----
2834
podman machine set --rootful
2935
----
3036
31-
Start your Podman machine using
37+
Start your Podman machine using:
38+
39+
[source,bash]
3240
----
3341
podman machine start
3442
----
3543
3644
Use the following command to build your `fedora-iot` image:
45+
46+
[source,bash]
3747
----
3848
podman -c podman-machine-default-root build --cap-add=all --security-opt=label=disable \
3949
--device /dev/fuse -t localhost/fedora-iot -f Containerfile.custom .
4050
----
4151
4252
After building the `localhost/fedora-iot` image, you should be able to see it in your Podman machine's list of images. Use the following command to check:
53+
54+
[source,bash]
4355
----
4456
podman -c podman-machine-default-root images
4557
----
4658
47-
NOTE: The next step uses `podman-bootc`. If you need to install `podman-bootc`, please follow the instructions in the
59+
NOTE: The next step uses `podman-bootc`. If you need to install `podman-bootc`, please follow the instructions in the
4860
https://github.com/containers/podman-bootc[podman-bootc repository]
4961
50-
You're now ready to boot a virtual machine using your new Fedora IoT bootc image. The command below will boot a VM in your current terminal window,
51-
allowing you to test everything that Fedora IoT bootc images have to offer:
62+
You're now ready to boot a virtual machine using your new Fedora IoT `bootc` image. The command below will boot a VM in your current terminal window,
63+
allowing you to test everything that Fedora IoT `bootc` images have to offer:
64+
65+
[source,bash]
5266
----
5367
podman-bootc run --filesystem=ext4 localhost/fedora-iot
5468
----

user-docs/modules/ROOT/pages/fedora-iot-bootc-quay-example.adoc

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
== Building and Booting a Fedora IoT Bootc Image
44

5-
This example walks through building and booting a Fedora IoT bootc image using Quay.io, as well as pushing an update to a booted
5+
This example walks through building and booting a Fedora IoT `bootc` image using Quay.io, as well as pushing an update to a booted
66
Fedora IoT system.
77

8-
NOTE: This example is based on the Fedora bootc documentation about building scratch images; reference the upstream docs
8+
NOTE: This example is based on the Fedora `bootc` documentation about building scratch images; reference the upstream docs
99
https://docs.fedoraproject.org/en-US/bootc/building-from-scratch/#_using_bootc_base_imagectl_build_rootfs[here] for the latest version/information.
1010

1111
NOTE: This example assumes the user has a Quay account with the ability to create custom repositories.
1212

1313
To start, create a `Containerfile.custom` with the following contents:
14+
15+
[source,dockerfile]
1416
----
1517
FROM quay.io/fedora-testing/fedora-bootc:rawhide-standard as builder
1618
RUN /usr/libexec/bootc-base-imagectl build-rootfs --manifest=fedora-iot /target-rootfs
@@ -23,99 +25,127 @@ STOPSIGNAL SIGRTMIN+3
2325
CMD ["/sbin/init"]
2426
----
2527

26-
You're now ready to build a Fedora IoT bootc image using the custom containerfile you made earlier. Use this command:
28+
You're now ready to build a Fedora IoT `bootc` image using the custom Containerfile you made earlier. Use this command:
29+
30+
[source,bash]
2731
----
2832
podman build --cap-add=all --security-opt=label=type:container_runtime_t \
2933
--device /dev/fuse -t localhost/fedora-iot -f Containerfile.custom .
3034
----
3135

32-
Then, tag your Fedora IoT bootc image:
36+
Then, tag your Fedora IoT `bootc` image:
37+
38+
[source,bash]
3339
----
3440
podman tag localhost/fedora-iot:latest quay.io/[quay repository name]:fedora-iot
3541
----
3642

37-
Before pushing to Quay.io, you may need to log in:
38-
----
39-
podman login quay.io
40-
----
43+
Before pushing to Quay.io, you may need to log in:
44+
45+
[source,bash]
46+
----
47+
podman login quay.io
48+
----
49+
50+
Push your new Fedora IoT `bootc` image to Quay.io using the following command. Note that you may need to log in again:
4151

42-
Push your new Fedora IoT bootc image to Quay.io using the following command. Note that you may need to log in again:
52+
[source,bash]
4353
----
4454
podman push quay.io/[quay repository name]:fedora-iot
4555
----
4656

47-
NOTE: The next step uses `podman-bootc`. If you need to install `podman-bootc`, please follow the instructions in the
57+
NOTE: The next step uses `podman-bootc`. If you need to install `podman-bootc`, please follow the instructions in the
4858
https://github.com/containers/podman-bootc[podman-bootc repository]
4959

50-
Now, boot your Fedora IoT bootc image. Open a new terminal window and run:
60+
Now, boot your Fedora IoT `bootc` image. Open a new terminal window and run:
61+
62+
[source,bash]
5163
----
5264
podman-bootc run --filesystem=ext4 quay.io/[quay repository name]:fedora-iot
5365
----
5466

55-
`podman-bootc` will pull your image and boot it inside a VM in the terminal window,
56-
allowing you to test everything Fedora IoT bootc images have to offer.
67+
`podman-bootc` will pull your image and boot it inside a VM in the terminal window,
68+
allowing you to test everything Fedora IoT `bootc` images have to offer.
5769

5870
== Pushing an Update to your Fedora IoT bootc system
5971

60-
After completing the tutorial above, you now have a functional Fedora IoT bootc system! But what if you need to make a change?
61-
Updating a bootc system is remarkably simple -- just follow the steps below.
72+
After completing the tutorial above, you now have a functional Fedora IoT `bootc` system! But what if you need to make a change?
73+
Updating a `bootc` system is remarkably simple -- just follow the steps below.
6274

63-
NOTE: This tutorial assumes you have just completed the above tutorial, and have access to a booted Fedora IoT bootc system.
75+
NOTE: This tutorial assumes you have just completed the above tutorial, and have access to a booted Fedora IoT `bootc` system.
6476

65-
First, navigate to your cloned Fedora Bootc Base Images repository and create a containerfile named `Containerfile.fix` with your desired changes.
77+
First, navigate to your cloned Fedora Bootc Base Images repository and create a Containerfile named `Containerfile.fix` with your desired changes.
6678

67-
Next, rebuild your `localhost/fedora-iot` image using the new containerfile:
79+
Next, rebuild your `localhost/fedora-iot` image using the new Containerfile:
80+
81+
[source,bash]
6882
----
6983
podman build --cap-add=all --security-opt=label=type:container_runtime_t \
7084
--device /dev/fuse -t localhost/fedora-iot -f Containerfile.fix .
7185
----
7286

73-
Tag your updated Fedora IoT bootc image:
87+
Tag your updated Fedora IoT `bootc` image:
88+
89+
[source,bash]
7490
----
7591
podman tag localhost/fedora-iot:latest quay.io/[quay repository name]:fedora-iot
7692
----
7793

7894
Before pushing to Quay.io, you may need to log in:
95+
96+
[source,bash]
7997
----
8098
podman login quay.io
8199
----
82100

83-
Push your updated Fedora IoT bootc image to Quay.io, using the command below:
101+
Push your updated Fedora IoT `bootc` image to Quay.io, using the command below:
102+
103+
[source,bash]
84104
----
85105
podman push quay.io/[quay repository name]:fedora-iot
86106
----
87107

88-
After successfully pushing, switch back to your virtual machine running your Fedora IoT bootc image.
108+
After successfully pushing, switch back to your virtual machine running your Fedora IoT `bootc` image.
89109
Download and queue the updated image for your next reboot:
110+
111+
[source,bash]
90112
----
91113
bootc upgrade
92114
----
93115

94116
Run the following command to see your updated image staged for the next reboot:
117+
118+
[source,bash]
95119
----
96120
bootc status
97121
----
98122

99-
Reboot your Fedora IoT bootc system and use your new updated image:
123+
Reboot your Fedora IoT `bootc` system and use your new updated image:
124+
125+
[source,bash]
100126
----
101127
reboot
102128
----
103129

104-
After rebooting, you may need to ssh back into your Fedora IoT bootc system. To do so, first list all podman-bootc
105-
VMs:
130+
After rebooting, you may need to SSH back into your Fedora IoT `bootc` system. To do so, first list all `podman-bootc` VMs:
131+
132+
[source,bash]
106133
----
107134
podman-bootc list
108135
----
109136

110137
Then find the ID of your desired machine and run the following:
138+
139+
[source,bash]
111140
----
112141
podman-bootc ssh [ID]
113142
----
114143

115144
After reconnecting, run check the status again:
145+
146+
[source,bash]
116147
----
117148
bootc status
118149
----
119150

120-
Your updated image should now show up
121-
as `Booted`, and the previous image as `Rollback`. You have successfully updated your Fedora IoT bootc system!
151+
Your updated image should now show up as `Booted`, and the previous image as `Rollback`. You have successfully updated your Fedora IoT bootc system!
Lines changed: 18 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,45 @@
11
= Fedora IoT Bootc Example with Raspberry Pi
22

3-
== Installing Fedora IoT on a SD Card
3+
Using `bootc` with Fedora IoT currently requires that you have already provisioned a device with Fedora IoT.
44

5-
To install Fedora IoT on a SD Card use the arm-image-installer. See xref:physical-device-setup.adoc[Physical Device Setup] for details.
5+
Follow the instructions in xref:physical-device-setup.adoc[Physical Device Setup] to provision Fedora IoT to your Raspberry Pi.
66

7-
For the Raspberry Pi 3 the command to create the SD Card is the following:
7+
Once the Raspberry Pi is provisioned successfully, you can create a custom Fedora `bootc` image.
88

9-
----
10-
sudo arm-image-installer --image=Fedora-IoT-raw-42-20250724.1.aarch64.raw.xz --media=/dev/sda --target=rpi3 --resizefs --addkey=id_rsa.pub
11-
----
12-
13-
This command expects, that your ssh key and the Fedora IoT image is present in the local directory.
9+
== Build a custom Fedora Bootc image and push it to a registry
1410

15-
After completion you can put the SD Card in the Raspberry Pi, boot and connect via SSH.
11+
To build your own image on your host you can create a Containerfile. This example just copies a file to `/etc`.
1612

17-
== Build a custom Fedora Bootc image and push it to GitLab
18-
19-
To build your own image on your host you can create a Containerfile. This example just copies a file to /etc.
13+
NOTE: this example uses the Fedora `bootc` base image and does not include all of the RPMs included as part of Fedora IoT.
2014

15+
[source,dockerfile]
2116
----
2217
FROM quay.io/fedora/fedora-bootc:latest
23-
2418
COPY files/secret /etc
2519
----
2620

27-
To build and push the image with podman run the following on the host:
21+
To build and push the image with `podman` run the following on the host:
2822

23+
[source,bash]
2924
----
30-
podman build --platform linux/arm64 -t gitlab.internal.net:5005/software/bootc/test-image:latest .
31-
podman login gitlab.internal.net:5005
32-
podman push gitlab.internal.net:5005/software/bootc/test-image:latest
25+
podman build --platform linux/arm64 -t quay.io/username/bootc-test-image:latest
26+
podman push quay.io/username/bootc-test-image:latest
3327
----
3428

35-
== Switch the Raspberry Pi to your custom image
36-
37-
On the Raspberry Pi you can now switch to your custom image.
38-
To access GitLab you need a Project Access Token with Role Developer and Permission `read_registry`.
39-
40-
To create a authentication file encode the GitLab token using an arbitrary user name to base64:
29+
This example uses https://quay.io/[Quay.io] as the registry; you may need additional configuration to push to the registry you are using.
4130

42-
----
43-
echo -n "no_user:glpat-thisisthegitlabprojectaccesstoken" | base64
44-
----
45-
46-
use the base64 string to create a image pull secret on the Raspberry Pi:
47-
48-
----
49-
cat << EOF > /etc/ostree/auth.json
50-
{
51-
"auths": {
52-
"gitlab.internal.net:5005": {
53-
"auth": "bm9fdXNlcjpnbHBhdC10aGlzaXN0aGVnaXRsYWJwcm9qZWN0YWNjZXNzdG9rZW4="
54-
}
55-
}
56-
}
57-
EOF
58-
----
59-
60-
To switch the bootc image you can now run on the Raspberry Pi:
61-
62-
----
63-
bootc switch gitlab.internal.net:5005/software/bootc/test-image:latest
64-
----
31+
== Switch the Raspberry Pi to your custom image
6532

66-
After rebooting:
33+
On the Raspberry Pi you can now switch to your custom image with the `bootc switch` command.
6734

35+
[source,bash]
6836
----
69-
reboot
37+
bootc switch quay.io/username/bootc-test-image:latest
7038
----
7139

72-
The file should be present in the filesystem:
40+
After rebooting the Raspberry Pi, the file copied as part of the Containerfile should be present in the filesystem:
7341

42+
[source,bash]
7443
----
7544
cat /etc/secret
7645
----
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
= Fedora IoT Bootc Images
22

3-
As part of Fedora's initiative towards bootable containers, you can now create Fedora IoT bootc images. These images use standard
4-
OCI/Docker containers as transport but contain all components needed to boot a Fedora IoT system. This allows you to ship updates to
3+
As part of Fedora's initiative towards bootable containers, you can now create Fedora IoT `bootc` images. These images use standard
4+
OCI/Docker containers as transport but contain all components needed to boot a Fedora IoT system. This allows you to ship updates to
55
your Fedora IoT system using container images.
66

7-
Bootc is part of the standard Fedora IoT distribution. After xref:physical-device-setup.adoc[setting up a Physical Device]
8-
you can use the Bootc tools to update the system.
7+
`bootc` is part of the standard Fedora IoT distribution. After xref:physical-device-setup.adoc[setting up a Physical Device]
8+
you can use the `bootc` tools to update the system.
99

10-
Essentially, Fedora IoT bootc images retain all the functionality you're used to in Fedora IoT, while leveraging the flexibility
11-
and ease of maintenance provided by bootc.
10+
Essentially, Fedora IoT `bootc` images retain all the functionality you're used to in Fedora IoT, while leveraging the flexibility
11+
and ease of maintenance provided by `bootc`.
1212

13-
For more information, please check out the https://docs.fedoraproject.org/en-US/bootc/[official bootc documentation], as well as the
13+
For more information, please check out the https://docs.fedoraproject.org/en-US/bootc/[official bootc documentation], as well as the
1414
https://gitlab.com/fedora/bootc/base-images[Fedora Bootc Base Images Git repository].

0 commit comments

Comments
 (0)