This repository is meant to be a template for building your own custom Universal Blue image. This template is the recommended way to make customizations to any image published by the Universal Blue Project:
or any other base image if you want to start from scratch:
- Fedora:
quay.io/fedora/fedora-bootc:41
- CentOS Stream 9:
quay.io/centos-bootc/centos-bootc:stream9
- CentOS Stream 10 (in development):
quay.io/centos-bootc/centos-bootc:stream10
This template includes a Containerfile and a Github workflow for building the container image, signing, and proper metadata to be listed on artifacthub. As soon as the workflow is enabled in your repository, it will build the container image and push it to the Github Container Registry.
Working knowledge in the following topics:
- Containers
- bootc
- Fedora Silverblue (and other Fedora Atomic variants)
- Github Workflows
Select Use this Template
and create a new repository from it. To enable the workflows, you may need to go the Actions
tab of the new repository and click to enable workflows.
This file defines the operations used to customize the selected image. It contains examples of possible modifications, including how to:
- change the upstream from which the custom image is derived
- add additional RPM packages
- add binaries as a layer from other images
This template provides an out of the box workflow for getting an ISO image for your custom OCI image which can be used to directly install onto your machines.
This template provides a way to upload the ISO that is generated from the workflow to a S3 bucket or it will be available as an artifact from the job. To upload to S3 we use a tool called rclone which is able to use many S3 providers. For more details on how to configure this see the details below.
This workflow creates your custom OCI image and publishes it to the Github Container Registry (GHCR). By default, the image name will match the Github repository name.
This workflow creates an ISO from your OCI image by utilizing the bootc-image-builder to generate an ISO. In order to use this workflow you must complete the following steps:
- Modify
iso.toml
to point to your custom image before generating an ISO. - If you changed your image name from the default in
build.yml
then in thebuild-iso.yml
file edit theIMAGE_REGISTRY
andDEFAULT_TAG
environment variables with the correct values. If you did not make changes, skip this step. - Finally, if you want to upload your ISOs to S3 then you will need to add your S3 configuration to the repository's Action secrets. This can be found by going to your repository settings, under
Secrets and Variables
->Actions
. You will need to add the followingS3_PROVIDER
- Must match one of the values from the supported listS3_BUCKET_NAME
- Your unique bucket nameS3_ACCESS_KEY_ID
- It is recommended that you make a separate key just for this workflowS3_SECRET_ACCESS_KEY
- See above.S3_REGION
- The region your bucket lives in. If you do not know then set this value toauto
.S3_ENDPOINT
- This value will be specific to the bucket as well.
Once the workflow is done, you'll find it either in your S3 bucket or as part of the summary under Artifacts
after the workflow is completed.
Container signing is important for end-user security and is enabled on all Universal Blue images. It is recommended you set this up, and by default the image builds will fail if you don't.
This provides users a method of verifying the image.
-
Install the cosign CLI tool
-
Run inside your repo folder:
cosign generate-key-pair
- Do NOT put in a password when it asks you to, just press enter. The signing key will be used in GitHub Actions and will not work if it is encrypted.
Warning
Be careful to never accidentally commit cosign.key
into your git repo.
-
Add the private key to GitHub
-
This can also be done manually. Go to your repository settings, under
Secrets and Variables
->Actions
Add a new secret and name it
SIGNING_SECRET
, then paste the contents ofcosign.key
into the secret and save it. Make sure it's the .key file and not the .pub file. Once done, it should look like this: -
(CLI instructions) If you have the
github-cli
installed, run:
gh secret set SIGNING_SECRET < cosign.key
-
-
Commit the
cosign.pub
file to the root of your git repository.
- bootc discussion forums - Nothing in this template is ublue specific, the upstream bootc project has a discussions forum where custom image builders can hang out and ask questions.
This template comes with the necessary tooling to index your image on artifacthub.io, use the artifacthub-repo.yml
file at the root to verify yourself as the publisher. This is important to you for a few reasons:
- The value of artifacthub is it's one place for people to index their custom images, and since we depend on each other to learn, it helps grow the community.
- You get to see your pet project listed with the other cool projects in Cloud Native.
- Since the site puts your README front and center, it's a good way to learn how to write a good README, learn some marketing, finding your audience, etc.