Skip to content

building diskimages (bootc) #7

building diskimages (bootc)

building diskimages (bootc) #7

name: build diskimages (bootc)
run-name: building diskimages (bootc)
on:
workflow_dispatch:
env:
DISK_TYPE: qcow2
ROOTFS: xfs
ARCH: amd64
BIB_IMAGE: quay.io/centos-bootc/bootc-image-builder:latest
BODY: "Fedora disk images"
jobs:
build:
name: Build qcow2 diskimages
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04
steps:
- name: Remove unwanted stuff
uses: gbraad-actions/remove-unwanted@v1
- uses: actions/checkout@v4
- name: Workaround podman issues in GH actions
run: |
# see https://github.com/osbuild/bootc-image-builder/issues/446
sudo rm -rf /var/lib/containers/storage
sudo mkdir -p /etc/containers
echo -e "[storage]\ndriver = \"overlay\"\nrunroot = \"/run/containers/storage\"\ngraphroot = \"/var/lib/containers/storage\"" | sudo tee /etc/containers/storage.conf
- name: Workarounds for GH runner diskspace
run: |
sudo mkdir -p /mnt/var/lib/containers
sudo mount -o bind /mnt/var/lib/containers /var/lib/containers
sudo mkdir /var/lib/containers/storage
- name: Create shared user configuration
run: cat config.toml.in > config.toml
- name: Build image - systemd
id: build-image-systemd
run: |
mkdir -p ./output
sudo podman pull ${{ env.IMAGE_NAME }}
sudo podman run \
--rm \
-it \
--privileged \
--pull=newer \
--security-opt label=type:unconfined_t \
-v ./config.toml:/config.toml:ro \
-v ./output:/output \
-v /var/lib/containers/storage:/var/lib/containers/storage \
${{ env.BIB_IMAGE }} \
--target-arch ${{ env.ARCH }} \
--type ${{ env.DISK_TYPE }} \
--rootfs ${{ env.ROOTFS }} \
--local \
${{ env.IMAGE_NAME }}
env:
IMAGE_NAME: ghcr.io/gbraad-devenv/fedora/systemd-bootc:41
- name: Rename output file - systemd
run: sudo mv ./output/qcow2/disk.qcow2 ./output/qcow2/systemd-disk.qcow2
- name: Build image - rdesktop
id: build-image-rdesktop
run: |
mkdir -p ./output
sudo podman pull ${{ env.IMAGE_NAME }}
sudo podman run \
--rm \
-it \
--privileged \
--pull=newer \
--security-opt label=type:unconfined_t \
-v ./config.toml:/config.toml:ro \
-v ./output:/output \
-v /var/lib/containers/storage:/var/lib/containers/storage \
${{ env.BIB_IMAGE }} \
--target-arch ${{ env.ARCH }} \
--type ${{ env.DISK_TYPE }} \
--rootfs ${{ env.ROOTFS }} \
--local \
${{ env.IMAGE_NAME }}
env:
IMAGE_NAME: ghcr.io/gbraad-devenv/fedora/rdesktop-bootc:41
- name: Rename output file - rdesktop
run: sudo mv ./output/qcow2/disk.qcow2 ./output/qcow2/rdesktop-disk.qcow2
- name: Build image - code-cli
id: build-image-code-cli
run: |
mkdir -p ./output
sudo podman pull ${{ env.IMAGE_NAME }}
sudo podman run \
--rm \
-it \
--privileged \
--pull=newer \
--security-opt label=type:unconfined_t \
-v ./config.toml:/config.toml:ro \
-v ./output:/output \
-v /var/lib/containers/storage:/var/lib/containers/storage \
${{ env.BIB_IMAGE }} \
--target-arch ${{ env.ARCH }} \
--type ${{ env.DISK_TYPE }} \
--rootfs ${{ env.ROOTFS }} \
--local \
${{ env.IMAGE_NAME }}
env:
IMAGE_NAME: ghcr.io/gbraad-devenv/fedora/code-cli-bootc:41
- name: Rename output file - code-cli
run: sudo mv ./output/qcow2/disk.qcow2 ./output/qcow2/code-cli-disk.qcow2
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: 41
name: Latest disk images
body: ${{ env.BODY }}
artifacts: "output/bootiso/*.iso,./output/qcow2/*,"