This repository is meant to be a template for building your own custom Universal Blue image using Earthly. This template is the recommended way to make customizations to any image published by the Universal Blue Project:
This template leverages Earthly for reproducible and efficient builds of your container image, orchestrated by GitHub Workflows. The built image is then pushed to the GitHub Container Registry.
Working knowledge in the following topics:
- Containers
- bootc
- Fedora Silverblue (and other Fedora Atomic variants)
- Earthly
- 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
The Earthfile orchestrates the build process. It utilizes the Containerfile as the base definition for your image layers and integrates additional packages. It also handles the tagging and pushing of the final image to the container registry.
Specifically, the Earthfile's build target:
- Builds the
Containerfile. - Integrates artifacts from Earthly builds defined in
packages/*. - Calls the
SAVE_IMAGEtarget to tag and push the image.
Modify iso.toml to point to your custom image before generating an ISO.
- (Steps in progress)
This workflow uses Earthly to create your custom OCI image and publishes it to the GitHub Container Registry (GHCR). It invokes the build target within the Earthfile, passing necessary arguments such as BASE_IMAGE, branch, and commit_hash.
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.
-
Add the private key to GitHub:
- This can be done manually. Go to your repository settings, under Secrets and Variables -> Actions.
- Add a new secret and name it
SIGNING_SECRET. - Paste the contents of your
cosign.keyin 6094 to the secret and save it. Make sure it's the.keyfile and not the.pubfile. - If you have the
github-cliinstalled, you can run:gh secret set SIGNING_SECRET < cosign.key
- The
cosign.keyis generated by runningcosign generate-key-pair. You should NOT provide a password when prompted for it, as the key will be used in GitHub Actions. - WARNING: Be careful to never accidentally commit
cosign.keyinto your git repo.
-
Commit the
cosign.pubfile 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.
- Index your image on artifacthub.io, use the
artifacthub-repo.ymlfile at the root to verify yourself as the publisher.