uphy-20241229/README.md

88 lines
3.2 KiB
Markdown
Raw Normal View History

2024-04-12 22:00:27 +00:00
# image-template
2024-03-04 01:00:00 +00:00
# Purpose
2024-12-03 03:50:53 +00:00
This repository is meant to be a template for building your own custom Universal Blue image.
2024-03-04 01:00:00 +00:00
# Prerequisites
Working knowledge in the following topics:
- Containers
- https://www.youtube.com/watch?v=SnSH8Ht3MIc
- https://www.mankier.com/5/Containerfile
2024-12-03 03:50:53 +00:00
- bootc
- https://containers.github.io/bootc/
2024-03-04 01:00:00 +00:00
- Fedora Silverblue (and other Fedora Atomic variants)
- https://docs.fedoraproject.org/en-US/fedora-silverblue/
2024-03-04 01:00:00 +00:00
- Github Workflows
- https://docs.github.com/en/actions/using-workflows
2024-03-04 01:00:00 +00:00
# How to Use
## Template
2024-04-12 22:03:10 +00:00
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.
2024-03-04 01:00:00 +00:00
## Containerfile
2024-12-03 03:50:53 +00:00
The top line is the base image you want to start FROM. Any valid image can be a starting point, examples include:
2024-12-03 03:59:13 +00:00
- `FROM ghcr.io/ublue-os/bazzite:latest`
- `FROM ghcr.io/ublue-os/bluefin:stable`
- `FROM ghcr.io/ublue-os/aurora-dx:stable`
2024-12-03 03:50:53 +00:00
2024-12-03 03:55:11 +00:00
## "Empty" base images
2024-12-03 03:50:53 +00:00
2024-12-03 03:55:11 +00:00
These contain a base system WITHOUT a pre-existing desktop. This is recommended for a more bottom up approach or if you want to to use a different desktop environment than is currently available:
2024-12-03 03:50:53 +00:00
2024-12-03 03:59:13 +00:00
- `FROM ghcr.io/ublue-os/base-main:latest`
2024-12-03 03:50:53 +00:00
Use `base-nvidia:latest` if you need the Nvidia drivers. You can also lock to a specific version like `base-nvidia:41`, etc.
2024-03-04 01:00:00 +00:00
## Workflows
2024-04-12 16:28:03 +00:00
### build.yml
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.
#### Container Signing
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.
1. Install the [cosign CLI tool](https://edu.chainguard.dev/open-source/sigstore/cosign/how-to-install-cosign/#installing-cosign-with-the-cosign-binary)
2. Run inside your repo folder:
```bash
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.
3. Add the private key to GitHub
- This can also be done manually. Go to your repository settings, under Secrets and Variables -> Actions
![image](https://user-images.githubusercontent.com/1264109/216735595-0ecf1b66-b9ee-439e-87d7-c8cc43c2110a.png)
Add a new secret and name it `SIGNING_SECRET`, then paste the contents of `cosign.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:
![image](https://user-images.githubusercontent.com/1264109/216735690-2d19271f-cee2-45ac-a039-23e6a4c16b34.png)
- (CLI instructions) If you have the `github-cli` installed, run:
2024-04-12 16:28:03 +00:00
```bash
gh secret set SIGNING_SECRET < cosign.key
```
2024-04-12 16:28:03 +00:00
4. Commit the `cosign.pub` file into your git repository
### Examples
- [m2os](https://github.com/m2giles/m2os)
- [bos](https://github.com/bsherman/bos)
- [homer](https://github.com/bketelsen/homer/)