Skip to content

Commit 55c47ac

Browse files
committed
Second pass
1 parent 401152c commit 55c47ac

File tree

1 file changed

+59
-37
lines changed

1 file changed

+59
-37
lines changed

README.md

Lines changed: 59 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,64 +6,86 @@ Welcome to your brand-new Atomic AlmaLinux Respin!
66

77
### Set basic configuration
88

9-
In the ["Build image"](.github/workflows/build.yml) and ["Build ISOs"](.github/workflows/build-iso.yml) jobs, you'll
10-
find a `set-env` job where you can configure several things:
9+
In the ["Build image"](.github/workflows/build.yml) and ["Build ISOs"](.github/workflows/build-iso.yml) workflows, you'll find a `set-env` job where you can configure several key variables:
1110

12-
- `REGISTRY`: the registry to push your image to
13-
- `REGISTRY_USER`: your username for this registry
14-
- `IMAGE_PATH`: the path to your image
15-
- `IMAGE_NAME`: your image's name
16-
- `PLATFORMS`: a comma-separated list of platforms for which to build your image, like `"amd64,arm64"`
11+
- `REGISTRY`: The container registry to push your image to (default: GitHub Container Registry `ghcr.io`).
12+
- `REGISTRY_USER`: Your username for the registry.
13+
- `IMAGE_PATH`: The path/namespace for your image.
14+
- `IMAGE_NAME`: The name of your image.
15+
- `PLATFORMS`: A quoted, comma-separated list of platforms to build for (e.g., `"amd64,arm64"`).
1716

18-
If your registry is not Github (ie. `ghcr.io`) or you need a specific token to authenticate
19-
to your registry, search those two jobs for the line `REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}`
20-
and replace the token for the appropriate secret.
17+
If your registry is not GitHub or you need a specific token, search for `REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}` in the workflow files and replace it with the appropriate secret.
2118

2219
### Pick a base desktop image
2320

24-
By default, this template configures the base image `quay.io/almalinuxorg/atomic-desktop-gnome:10`,
25-
which is [maintained](https://github.com/AlmaLinux/atomic-desktop) by the [AlmaLinux Atomic SIG](https://wiki.almalinux.org/sigs/Atomic.html).
26-
If you're not a fan of Gnome, you could also pick our KDE image (`quay.io/almalinuxorg/atomic-desktop-kde:10`).
21+
By default, this template uses the base image `quay.io/almalinuxorg/atomic-desktop-gnome:10`, maintained by the [AlmaLinux Atomic SIG](https://wiki.almalinux.org/sigs/Atomic.html). If you prefer KDE, you can use `quay.io/almalinuxorg/atomic-desktop-kde:10` instead.
2722

28-
If you'd like to switch images, change the `FROM` line in the [Dockerfile](Dockerfile).
29-
If you switch to an entirely new key, note that you will also have to download a new Cosign public
30-
key for this image and specify it's name in the `upstream-public-key` configuration
31-
parameter of `/.github/workflows/build.yml`, or remove that parameter altogether to
32-
disable key verification.
23+
To switch images, change the `FROM` line in the [Dockerfile](Dockerfile). If your image use a different signing key, download the new Cosign public key and specify its name in the `upstream-public-key` parameter in `.github/workflows/build.yml`, or remove the parameter to disable key verification.
3324

3425
### Setting up Cosign (Optional)
3526

36-
If you'd like to sign your images using Cosign, here's what you need to do:
27+
If you'd like to sign your images using Cosign:
3728

3829
1. Generate a cosign key:
39-
`podman run --rm -it -v /tmp:/cosign-keys bitnami/cosign generate-key-pair`
40-
Hit enter when asked for a private key password (that is, don't set a password). Once complete, you'll find the new key in `/tmp/cosign.{key,pub}` on your machine.
41-
42-
2. Add `cosign.pub` to this repository as `/cosign.pub`, commit and push. Feel free to publish this file in other places too, it will be needed by everyone to verify the signature of the published images.
43-
44-
3. In the github repo settings, go to "Secrets and variables" in the "Security" subsection and click on "Actions". Create a new Repository secret called `SIGNING_SECRET` and paste the contents of `cosign.key`. Save `cosign.key` in a secure location and delete it from your /tmp directory.
30+
```sh
31+
podman run --rm -it -v /tmp:/cosign-keys bitnami/cosign generate-key-pair
32+
```
33+
Leave the password blank. The keys will be in `/tmp/cosign.{key,pub}`.
34+
2. Add `cosign.pub` to the repository as `/cosign.pub`, commit, and push. This file is public and needed for signature verification.
35+
3. In GitHub repo settings, go to "Secrets and variables" > "Actions". Create a secret called `SIGNING_SECRET` and paste the contents of `cosign.key`. Store `cosign.key` securely and delete it from `/tmp`.
4536

4637
## Customizing your respin
4738

48-
Now that you're all set up, it's time for the fun part!
39+
Now you're ready to make your respin your own!
4940

5041
### Adding files
5142

52-
Any files you place in [`/files/system/`](files/system/) will be added to your image as is,
53-
preserving directory structure and file permissions. This is a simple mechanism for adding
54-
themes, backgrounds, etc.
43+
Place any files you want to include in your image in [`/files/system/`](files/system/). The directory structure and permissions will be preserved. This is ideal for adding themes, backgrounds, configuration files, etc.
5544

5645
### Executing commands
5746

58-
In [`/files/scripts/`](files/scripts/), you'll find a series of scripts that will be run
59-
during image creation. The `build.sh` script will first copy all the files from `/files/system/`
60-
into the image, then run the scripts in order, and finally run `cleanup.sh`. You can start by modifying [`10-base.sh`](files/scripts/10-base.sh)
61-
to suit your needs, and add more scripts as needed (always with the naming scheme `XX-whatever.sh`, where XX is a number).
47+
Scripts in [`/files/scripts/`](files/scripts/) are run during image creation. The `build.sh` script copies files from `/files/system/` into the image, then runs all scripts in order, and finally runs `cleanup.sh`.
6248

63-
Do not modify `build.sh`, `cleanup.sh`, `90-signing.sh` or `91-image-info.sh` unless you
64-
understand what you're doing, those scripts should not need any customization under normal circumstances.
49+
- Start by editing [`10-base.sh`](files/scripts/10-base.sh) to suit your needs.
50+
- Add more scripts as needed, using the naming scheme `XX-whatever.sh` (where `XX` is a number).
51+
- Do **not** modify `build.sh`, `cleanup.sh`, `90-signing.sh`, or `91-image-info.sh` unless you know what you're doing.
6552

6653
### Build your new image
6754

68-
Once you've added your files and scripts, commit your changes to let the CI build a new
69-
image for you. You can also run `make image` on your machine to build the image locally.
55+
After adding your files and scripts, commit your changes. The CI will build a new image for you automatically. You can also build locally:
56+
57+
```sh
58+
make image
59+
```
60+
61+
#### Local development with Makefile
62+
63+
The provided `Makefile` includes several useful commands for local development and testing:
64+
65+
- `make image`: Build the container image using Podman.
66+
- `make clean`: Remove the `./output` directory and build artifacts.
67+
- `make iso`: Build a bootable ISO image using [bootc-image-builder](https://github.com/osbuild/bootc-image-builder).
68+
- `make qcow2`: Build a QCOW2 disk image using bootc-image-builder.
69+
- `make run-qemu-iso`: Boot the generated ISO in QEMU for testing. Creates a virtual disk if needed.
70+
- `make run-qemu-qcow`: Boot the generated QCOW2 disk image in QEMU for testing.
71+
- `make run-qemu`: Boot the raw disk image in QEMU (after installation).
72+
73+
> **Note:** You may need `sudo` privileges and Podman installed. For more details, see the `Makefile`.
74+
75+
## Continuous Integration (CI)
76+
77+
This template is set up with GitHub Actions workflows to build, test, and (optionally) sign your images automatically on every push or pull request. See the `.github/workflows/` directory for details.
78+
79+
## Troubleshooting
80+
81+
- **Build fails locally:** Ensure you have Podman and QEMU installed, and that you have the necessary permissions (try running with `sudo`).
82+
- **CI build fails:** Check the Actions tab in GitHub for logs. Make sure your secrets and configuration are correct.
83+
- **Image doesn't boot in QEMU:** Double-check your custom scripts and added files for errors.
84+
85+
## Resources
86+
87+
- [AlmaLinux Atomic SIG](https://wiki.almalinux.org/sigs/Atomic.html)
88+
- [AlmaLinux Atomic Desktop Images](https://github.com/AlmaLinux/atomic-desktop)
89+
- [bootc-image-builder](https://github.com/osbuild/bootc-image-builder)
90+
- [Podman documentation](https://podman.io/)
91+
- [QEMU documentation](https://www.qemu.org/)

0 commit comments

Comments
 (0)