From 299c8e0e2f9054c07dfc2d26cadcc3164f7510cb Mon Sep 17 00:00:00 2001 From: Christian Glombek Date: Tue, 10 Jun 2025 02:15:44 +0200 Subject: chore: simplify (#111) --- .github/workflows/build-disk.yml | 115 +++++++++++++++++++++++++++++++++++++++ .github/workflows/build-iso.yml | 103 ----------------------------------- .github/workflows/build.yml | 46 +++++++--------- Justfile | 67 +++++++---------------- README.md | 32 +++++------ disk_config/disk.toml | 3 + disk_config/iso.toml | 19 +++++++ image.toml | 3 - iso.toml | 19 ------- 9 files changed, 189 insertions(+), 218 deletions(-) create mode 100644 .github/workflows/build-disk.yml delete mode 100644 .github/workflows/build-iso.yml create mode 100644 disk_config/disk.toml create mode 100644 disk_config/iso.toml delete mode 100644 image.toml delete mode 100644 iso.toml diff --git a/.github/workflows/build-disk.yml b/.github/workflows/build-disk.yml new file mode 100644 index 0000000..e0d0cac --- /dev/null +++ b/.github/workflows/build-disk.yml @@ -0,0 +1,115 @@ +--- +name: Build disk images + +on: + workflow_dispatch: + inputs: + upload-to-s3: + description: "Upload to S3" + required: false + default: false + type: boolean + platform: + required: true + type: choice + options: + - amd64 + - arm64 + pull_request: + branches: + - main + paths: + - './disk_config/disk.toml' + - './disk_config/iso.toml' + - './.github/workflows/build-disk.yml' + +env: + IMAGE_NAME: ${{ github.event.repository.name }} # output of build.yml, keep in sync + IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}" # do not edit + DEFAULT_TAG: "latest" + BIB_IMAGE: "ghcr.io/lorbuschris/bootc-image-builder:20250608" # "quay.io/centos-bootc/bootc-image-builder:latest" - see https://github.com/osbuild/bootc-image-builder/pull/954 + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true + +jobs: + build: + name: Build disk images + runs-on: ${{ inputs.platform == 'amd64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }} + strategy: + fail-fast: false + matrix: + disk-type: ["qcow2", "anaconda-iso"] + permissions: + contents: read + packages: read + id-token: write + + steps: + - name: Prepare environment + run: | + USER_UID=$(id -u) + USER_GID=$(id -g) + # Concatenate the types with a hyphen + DISK_TYPE=$(echo "${{ matrix.disk-type }}" | tr ' ' '-') + # Lowercase the image uri + echo "IMAGE_REGISTRY=${IMAGE_REGISTRY,,}" >> ${GITHUB_ENV} + echo "IMAGE_NAME=${IMAGE_NAME,,}" >> ${GITHUB_ENV} + echo "DISK_TYPE=${DISK_TYPE}" >> ${GITHUB_ENV} + echo "USER_UID=${USER_UID}" >> ${GITHUB_ENV} + echo "USER_GID=${USER_GID}" >> ${GITHUB_ENV} + + - name: Install dependencies + if: inputs.platform == 'arm64' + run: | + set -x + sudo apt update -y + sudo apt install -y \ + podman + + - name: Maximize build space + if: inputs.platform != 'arm64' + uses: ublue-os/remove-unwanted-software@cc0becac701cf642c8f0a6613bbdaf5dc36b259e # v9 + with: + remove-codeql: true + + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Build disk images + id: build + uses: osbuild/bootc-image-builder-action@main + with: + builder-image: ${{ env.BIB_IMAGE }} + config-file: ${{ matrix.disk-type == 'anaconda-iso' && './disk_config/iso.toml' || './disk_config/disk.toml' }} + image: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DEFAULT_TAG }} + chown: ${{ env.USER_UID }}:${{ env.USER_GID }} + types: ${{ matrix.disk-type }} + additional-args: --use-librepo=True + + - name: Upload disk images and Checksum to Job Artifacts + if: inputs.upload-to-s3 != true && github.event_name != 'pull_request' + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + path: ${{ steps.build.outputs.output-directory }} + if-no-files-found: error + retention-days: 0 + compression-level: 0 + overwrite: true + + - name: Upload to S3 + if: inputs.upload-to-s3 == true && github.event_name != 'pull_request' + shell: bash + env: + RCLONE_CONFIG_S3_TYPE: s3 + RCLONE_CONFIG_S3_PROVIDER: ${{ secrets.S3_PROVIDER }} + RCLONE_CONFIG_S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }} + RCLONE_CONFIG_S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }} + RCLONE_CONFIG_S3_REGION: ${{ secrets.S3_REGION }} + RCLONE_CONFIG_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + SOURCE_DIR: ${{ steps.build.outputs.output-directory }} + run: | + sudo apt-get update + sudo apt-get install -y rclone + rclone copy $SOURCE_DIR S3:${{ secrets.S3_BUCKET_NAME }} \ No newline at end of file diff --git a/.github/workflows/build-iso.yml b/.github/workflows/build-iso.yml deleted file mode 100644 index b8aa38e..0000000 --- a/.github/workflows/build-iso.yml +++ /dev/null @@ -1,103 +0,0 @@ ---- -name: Build ISOs - -on: - workflow_dispatch: - inputs: - upload-to-s3: - description: "Upload to S3" - required: false - default: false - type: boolean - platform: - required: true - type: choice - options: - - amd64 - - arm64 - pull_request: - branches: - - main - paths: - - './iso.toml' - - './.github/workflows/build-iso.yml' - - './Justfile' - -env: - IMAGE_REGISTRY: "ghcr.io/${{ github.repository }}" - DEFAULT_TAG: "latest" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - build: - name: Build ISOs - runs-on: ${{ inputs.platform == 'amd64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }} - strategy: - fail-fast: false - permissions: - contents: read - packages: read - id-token: write - - steps: - - name: lower case the image registry in case of any capitalization - run: | - echo "IMAGE_REGISTRY=${IMAGE_REGISTRY,,}" >> ${GITHUB_ENV} - - - name: Install dependencies - if: inputs.platform == 'arm64' - run: | - set -x - sudo apt update -y - sudo apt install -y \ - podman - - - name: Maximize build space - if: inputs.platform != 'arm64' - uses: ublue-os/remove-unwanted-software@cc0becac701cf642c8f0a6613bbdaf5dc36b259e # v9 - with: - remove-codeql: true - - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - - name: Setup Just - uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3 - - - name: Build ISO - id: build - uses: ublue-os/bootc-image-builder-action@main - with: - bootc-image-builder-image: ghcr.io/centos-workstation/bootc-image-builder:latest - use-librepo: true - config-file: ./iso.toml - image: ${{ env.IMAGE_REGISTRY }}:${{ env.DEFAULT_TAG }} - - - name: Upload ISOs and Checksum to Job Artifacts - if: inputs.upload-to-s3 != true && github.event_name != 'pull_request' - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 - with: - path: ${{ steps.build.outputs.output-directory }} - if-no-files-found: error - retention-days: 0 - compression-level: 0 - overwrite: true - - - name: Upload to S3 - if: inputs.upload-to-s3 == true && github.event_name != 'pull_request' - shell: bash - env: - RCLONE_CONFIG_S3_TYPE: s3 - RCLONE_CONFIG_S3_PROVIDER: ${{ secrets.S3_PROVIDER }} - RCLONE_CONFIG_S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }} - RCLONE_CONFIG_S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }} - RCLONE_CONFIG_S3_REGION: ${{ secrets.S3_REGION }} - RCLONE_CONFIG_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} - SOURCE_DIR: ${{ steps.build.outputs.output-directory }} - run: | - sudo apt-get update - sudo apt-get install -y rclone - rclone copy $SOURCE_DIR S3:${{ secrets.S3_BUCKET_NAME }} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad0d565..8e6e384 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ --- -name: Build Custom Image +name: Build container image on: pull_request: branches: @@ -14,10 +14,12 @@ on: workflow_dispatch: env: - IMAGE_NAME: "${{ github.event.repository.name }}" # the name of the image produced by this build, matches repo names IMAGE_DESC: "My Customized Universal Blue Image" + IMAGE_KEYWORDS: "bootc,ublue,universal-blue" + IMAGE_LOGO_URL: "https://avatars.githubusercontent.com/u/120078124?s=200&v=4" # Put your own image here for a fancy profile on https://artifacthub.io/! + IMAGE_NAME: "${{ github.event.repository.name }}" # output image name, usually same as repo name IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}" # do not edit - ARTIFACTHUB_LOGO_URL: "https://avatars.githubusercontent.com/u/120078124?s=200&v=4" # You should put your own image here so that you get a fancy profile image on https://artifacthub.io/! + DEFAULT_TAG: "latest" concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }}-${{ inputs.brand_name}}-${{ inputs.stream_name }} @@ -34,6 +36,12 @@ jobs: id-token: write steps: + - name: Prepare environment + run: | + # Lowercase the image uri + echo "IMAGE_REGISTRY=${IMAGE_REGISTRY,,}" >> ${GITHUB_ENV} + echo "IMAGE_NAME=${IMAGE_NAME,,}" >> ${GITHUB_ENV} + # These stage versions are pinned by https://github.com/renovatebot/renovate - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 @@ -60,10 +68,10 @@ jobs: id: metadata with: # This generates all the tags for your image, you can add custom tags here too! - # By default, it should generate "latest" and "latest.(date here)". + # Default tags are "$DEFAULT_TAG" and "$DEFAULT_TAG.$date". tags: | - type=raw,value=latest - type=raw,value=latest.{{date 'YYYYMMDD'}} + type=raw,value=${{ env.DEFAULT_TAG }} + type=raw,value=${{ env.DEFAULT_TAG }}.{{date 'YYYYMMDD'}} type=raw,value={{date 'YYYYMMDD'}} type=sha,enable=${{ github.event_name == 'pull_request' }} type=ref,event=pr @@ -76,11 +84,11 @@ jobs: org.opencontainers.image.title=${{ env.IMAGE_NAME }} org.opencontainers.image.url=https://github.com/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} org.opencontainers.image.vendor=${{ github.repository_owner }} - org.opencontainers.image.version=latest + org.opencontainers.image.version=${{ env.DEFAULT_TAG }}.{{date 'YYYYMMDD'}} io.artifacthub.package.deprecated=false - io.artifacthub.package.keywords=bootc,ublue,universal-blue + io.artifacthub.package.keywords=${{ env.IMAGE_KEYWORDS }} io.artifacthub.package.license=Apache-2.0 - io.artifacthub.package.logo-url=${{ env.ARTIFACTHUB_LOGO_URL }} + io.artifacthub.package.logo-url=${{ env.IMAGE_LOGO_URL }} io.artifacthub.package.prerelease=false containers.bootc=1 sep-tags: " " @@ -133,20 +141,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - # Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR. - # https://github.com/macbre/push-to-ghcr/issues/12 - - name: Lowercase Registry - id: registry_case - uses: ASzc/change-string-case-action@d0603cd0a7dd490be678164909f65c7737470a7f # v6 - with: - string: ${{ env.IMAGE_REGISTRY }} - - - name: Lowercase Image - id: image_case - uses: ASzc/change-string-case-action@d0603cd0a7dd490be678164909f65c7737470a7f # v6 - with: - string: ${{ env.IMAGE_NAME }} - - name: Push To GHCR uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2 if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) @@ -155,8 +149,8 @@ jobs: REGISTRY_USER: ${{ github.actor }} REGISTRY_PASSWORD: ${{ github.token }} with: - registry: ${{ steps.registry_case.outputs.lowercase }} - image: ${{ steps.image_case.outputs.lowercase }} + registry: ${{ env.IMAGE_REGISTRY }} + image: ${{ env.IMAGE_NAME }} tags: ${{ steps.metadata.outputs.tags }} username: ${{ env.REGISTRY_USER }} password: ${{ env.REGISTRY_PASSWORD }} @@ -172,7 +166,7 @@ jobs: - name: Sign container image if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) run: | - IMAGE_FULL="${{ steps.registry_case.outputs.lowercase }}/${{ steps.image_case.outputs.lowercase }}" + IMAGE_FULL="${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}" for tag in ${{ steps.metadata.outputs.tags }}; do cosign sign -y --key env://COSIGN_PRIVATE_KEY $IMAGE_FULL:$tag done diff --git a/Justfile b/Justfile index 098ad43..6ea8bcf 100644 --- a/Justfile +++ b/Justfile @@ -1,7 +1,4 @@ -export repo_organization := env("GITHUB_REPOSITORY_OWNER", "yourname") -export image_name := env("IMAGE_NAME", "yourimage") -export centos_version := env("CENTOS_VERSION", "stream10") -export fedora_version := env("CENTOS_VERSION", "41") +export image_name := env("IMAGE_NAME", "image-template") # output image name, usually same as repo name, change as needed export default_tag := env("DEFAULT_TAG", "latest") export bib_image := env("BIB_IMAGE", "quay.io/centos-bootc/bootc-image-builder:latest") @@ -74,47 +71,25 @@ sudoif command *args: # This Justfile recipe builds a container image using Podman. # # Arguments: -# $target_image - The tag you want to apply to the image (default: aurora). -# $tag - The tag for the image (default: lts). -# $dx - Enable DX (default: "0"). -# $hwe - Enable HWE (default: "0"). -# $gdx - Enable GDX (default: "0"). -# -# DX: -# Developer Experience (DX) is a feature that allows you to install the latest developer tools for your system. -# Packages include VScode, Docker, Distrobox, and more. -# HWE: -# Hardware Enablement (HWE) is a feature that allows you to install the latest hardware support for your system. -# Currently this install the Hyperscale SIG kernel which will stay ahead of the CentOS Stream kernel and enables btrfs -# GDX: https://docs.projectaurora.io/gdx/ -# GPU Developer Experience (GDX) creates a base as an AI and Graphics platform. -# Installs Nvidia drivers, CUDA, and other tools. +# $target_image - The tag you want to apply to the image (default: $image_name). +# $tag - The tag for the image (default: $default_tag). # # The script constructs the version string using the tag and the current date. # If the git working directory is clean, it also includes the short SHA of the current HEAD. # -# just build $target_image $tag $dx $hwe $gdx +# just build $target_image $tag # # Example usage: -# just build aurora lts 1 0 1 +# just build aurora lts # # This will build an image 'aurora:lts' with DX and GDX enabled. # # Build the image using the specified parameters -build $target_image=image_name $tag=default_tag $dx="0" $hwe="0" $gdx="0": +build $target_image=image_name $tag=default_tag: #!/usr/bin/env bash - # Get Version - ver="${tag}-${centos_version}.$(date +%Y%m%d)" - BUILD_ARGS=() - BUILD_ARGS+=("--build-arg" "MAJOR_VERSION=${centos_version}") - BUILD_ARGS+=("--build-arg" "IMAGE_NAME=${target_image}") - BUILD_ARGS+=("--build-arg" "IMAGE_VENDOR=${repo_organization}") - BUILD_ARGS+=("--build-arg" "ENABLE_DX=${dx}") - BUILD_ARGS+=("--build-arg" "ENABLE_HWE=${hwe}") - BUILD_ARGS+=("--build-arg" "ENABLE_GDX=${gdx}") if [[ -z "$(git status -s)" ]]; then BUILD_ARGS+=("--build-arg" "SHA_HEAD_SHORT=$(git rev-parse --short HEAD)") fi @@ -180,9 +155,9 @@ _rootful_load_image $target_image=image_name $tag=default_tag: # target_image: The name of the image to build (ex. localhost/fedora) # tag: The tag of the image to build (ex. latest) # type: The type of image to build (ex. qcow2, raw, iso) -# config: The configuration file to use for the build (default: image.toml) +# config: The configuration file to use for the build (default: disk_config/disk.toml) -# Example: just _rebuild-bib localhost/fedora latest qcow2 image.toml +# Example: just _rebuild-bib localhost/fedora latest qcow2 disk_config/disk.toml _build-bib $target_image $tag $type $config: (_rootful_load_image target_image tag) #!/usr/bin/env bash set -euo pipefail @@ -191,10 +166,6 @@ _build-bib $target_image $tag $type $config: (_rootful_load_image target_image t args+="--use-librepo=True " args+="--rootfs=btrfs" - if [[ $target_image == localhost/* ]]; then - args+=" --local" - fi - BUILDTMP=$(mktemp -p "${PWD}" -d -t _build-bib.XXXXXXXXXX) sudo podman run \ @@ -221,34 +192,34 @@ _build-bib $target_image $tag $type $config: (_rootful_load_image target_image t # target_image: The name of the image to build (ex. localhost/fedora) # tag: The tag of the image to build (ex. latest) # type: The type of image to build (ex. qcow2, raw, iso) -# config: The configuration file to use for the build (deafult: image.toml) +# config: The configuration file to use for the build (deafult: disk_config/disk.toml) -# Example: just _rebuild-bib localhost/fedora latest qcow2 image.toml +# Example: just _rebuild-bib localhost/fedora latest qcow2 disk_config/disk.toml _rebuild-bib $target_image $tag $type $config: (build target_image tag) && (_build-bib target_image tag type config) # Build a QCOW2 virtual machine image [group('Build Virtal Machine Image')] -build-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "qcow2" "image.toml") +build-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "qcow2" "disk_config/disk.toml") # Build a RAW virtual machine image [group('Build Virtal Machine Image')] -build-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "raw" "image.toml") +build-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "raw" "disk_config/disk.toml") # Build an ISO virtual machine image [group('Build Virtal Machine Image')] -build-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "iso" "iso.toml") +build-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "iso" "disk_config/iso.toml") # Rebuild a QCOW2 virtual machine image [group('Build Virtal Machine Image')] -rebuild-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "qcow2" "image.toml") +rebuild-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "qcow2" "disk_config/disk.toml") # Rebuild a RAW virtual machine image [group('Build Virtal Machine Image')] -rebuild-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "raw" "image.toml") +rebuild-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "raw" "disk_config/disk.toml") # Rebuild an ISO virtual machine image [group('Build Virtal Machine Image')] -rebuild-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "iso" "iso.toml") +rebuild-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "iso" "disk_config/iso.toml") # Run a virtual machine with the specified image type and configuration _run-vm $target_image $tag $type $config: @@ -294,15 +265,15 @@ _run-vm $target_image $tag $type $config: # Run a virtual machine from a QCOW2 image [group('Run Virtal Machine')] -run-vm-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "qcow2" "image.toml") +run-vm-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "qcow2" "disk_config/disk.toml") # Run a virtual machine from a RAW image [group('Run Virtal Machine')] -run-vm-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "raw" "image.toml") +run-vm-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "raw" "disk_config/disk.toml") # Run a virtual machine from an ISO [group('Run Virtal Machine')] -run-vm-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "iso" "iso.toml") +run-vm-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "iso" "disk_config/iso.toml") # Run a virtual machine using systemd-vmspawn [group('Run Virtal Machine')] diff --git a/README.md b/README.md index 609f6c8..86aaf76 100644 --- a/README.md +++ b/README.md @@ -46,11 +46,11 @@ This file defines the operations used to customize the selected image. It contai - add additional RPM packages - add binaries as a layer from other images -## Building an ISO +## Building disk 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 an out of the box workflow for creating ISO and other disk images 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](https://rclone.org/) which is able to use [many S3 providers](https://rclone.org/s3/). For more details on how to configure this see the details [below](#build-isoyml). +This template provides a way to upload the disk images 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](https://rclone.org/) which is able to use [many S3 providers](https://rclone.org/s3/). For more details on how to configure this see the details [below](#build-isoyml). ## Workflows @@ -58,13 +58,13 @@ This template provides a way to upload the ISO that is generated from the workfl 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. -### build-iso.yml +### build-disk.yml -This workflow creates an ISO from your OCI image by utilizing the [bootc-image-builder](https://osbuild.org/docs/bootc/) to generate an ISO. In order to use this workflow you must complete the following steps: +This workflow creates a disk images from your OCI image by utilizing the [bootc-image-builder](https://osbuild.org/docs/bootc/). 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 the `build-iso.yml` file edit the `IMAGE_REGISTRY` and `DEFAULT_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 following +- Modify `disk_config/iso.toml` to point to your custom container image before generating an ISO image. +- If you changed your image name from the default in `build.yml` then in the `build-disk.yml` file edit the `IMAGE_REGISTRY`, `IMAGE_NAME` and `DEFAULT_TAG` environment variables with the correct values. If you did not make changes, skip this step. +- Finally, if you want to upload your disk images 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 following - `S3_PROVIDER` - Must match one of the values from the [supported list](https://rclone.org/s3/) - `S3_BUCKET_NAME` - Your unique bucket name - `S3_ACCESS_KEY_ID` - It is recommended that you make a separate key just for this workflow @@ -72,7 +72,7 @@ This workflow creates an ISO from your OCI image by utilizing the [bootc-image-b - `S3_REGION` - The region your bucket lives in. If you do not know then set this value to `auto`. - `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. +Once the workflow is done, you'll find the disk images either in your S3 bucket or as part of the summary under `Artifacts` after the workflow is completed. #### Container Signing @@ -130,10 +130,7 @@ This `Justfile` contains various commands and configurations for building and ma #### Environment Variables -- `repo_organization`: The GitHub repository owner (default: "yourname"). -- `image_name`: The name of the image (default: "yourimage"). -- `centos_version`: The CentOS version (default: "stream10"). -- `fedora_version`: The Fedora version (default: "41"). +- `image_name`: The name of the image (default: "image-template"). - `default_tag`: The default tag for the image (default: "latest"). - `bib_image`: The Bootc Image Builder (BIB) image (default: "quay.io/centos-bootc/bootc-image-builder:latest"). @@ -165,15 +162,12 @@ Cleans the repository by removing build artifacts. Builds a container image using Podman. ```bash -just build $target_image $tag $dx $hwe $gdx +just build $target_image $tag ``` Arguments: -- `$target_image`: The tag you want to apply to the image (default: aurora). -- `$tag`: The tag for the image (default: lts). -- `$dx`: Enable DX (default: "0"). -- `$hwe`: Enable HWE (default: "0"). -- `$gdx`: Enable GDX (default: "0"). +- `$target_image`: The tag you want to apply to the image (default: `$image_name`). +- `$tag`: The tag for the image (default: `$default_tag`). ##### Building Virtual Machines and ISOs diff --git a/disk_config/disk.toml b/disk_config/disk.toml new file mode 100644 index 0000000..7478400 --- /dev/null +++ b/disk_config/disk.toml @@ -0,0 +1,3 @@ +[[customizations.filesystem]] +mountpoint = "/" +minsize = "20 GiB" diff --git a/disk_config/iso.toml b/disk_config/iso.toml new file mode 100644 index 0000000..d4c8f37 --- /dev/null +++ b/disk_config/iso.toml @@ -0,0 +1,19 @@ +[customizations.installer.kickstart] +contents = """ +%post +bootc switch --mutate-in-place --transport registry ghcr.io/ublue-os/image-template:latest +%end +""" + +[customizations.installer.modules] +enable = [ + "org.fedoraproject.Anaconda.Modules.Storage" +] +disable = [ + "org.fedoraproject.Anaconda.Modules.Network", + "org.fedoraproject.Anaconda.Modules.Security", + "org.fedoraproject.Anaconda.Modules.Services", + "org.fedoraproject.Anaconda.Modules.Users", + "org.fedoraproject.Anaconda.Modules.Subscription", + "org.fedoraproject.Anaconda.Modules.Timezone" +] diff --git a/image.toml b/image.toml deleted file mode 100644 index 7478400..0000000 --- a/image.toml +++ /dev/null @@ -1,3 +0,0 @@ -[[customizations.filesystem]] -mountpoint = "/" -minsize = "20 GiB" diff --git a/iso.toml b/iso.toml deleted file mode 100644 index 21b6913..0000000 --- a/iso.toml +++ /dev/null @@ -1,19 +0,0 @@ -[customizations.installer.kickstart] -contents = """ -%post -bootc switch --mutate-in-place --transport registry ghcr.io/yourrepo/yourimage:latest -%end -""" - -[customizations.installer.modules] -enable = [ - "org.fedoraproject.Anaconda.Modules.Storage" -] -disable = [ - "org.fedoraproject.Anaconda.Modules.Network", - "org.fedoraproject.Anaconda.Modules.Security", - "org.fedoraproject.Anaconda.Modules.Services", - "org.fedoraproject.Anaconda.Modules.Users", - "org.fedoraproject.Anaconda.Modules.Subscription", - "org.fedoraproject.Anaconda.Modules.Timezone" -] -- cgit v1.2.3