Skip to content

Commit

Permalink
Merge pull request #6 from tulilirockz/justfile-w-bootc-image-builder
Browse files Browse the repository at this point in the history
feat(just): add bootc-image-builder step + use buildah for build
  • Loading branch information
lleyton authored Nov 23, 2024
2 parents d9012ce + fd69366 commit c078eba
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
8 changes: 8 additions & 0 deletions image-builder.config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[[customizations.user]]
name = "ultramarine"
password = "ultramarine"
groups = ["wheel"]

[[customizations.filesystem]]
mountpoint = "/"
minsize = "20 GiB"
32 changes: 29 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
registry_prefix = "ghcr.io/ultramarine-linux"
registry_prefix := "ghcr.io/ultramarine-linux"
build variant:
sudo podman build --security-opt=label=disable --cap-add=all --device /dev/fuse -t {{registry_prefix}}/{{variant}}-bootc {{variant}}

buildah bud -t {{ registry_prefix }}/{{ variant }}-bootc {{ variant }}

build-vm image type="qcow2":
#!/usr/bin/env bash
set -euo pipefail
TARGET_IMAGE={{ image }}
if ! sudo podman image exists $TARGET_IMAGE ; then
echo "Ensuring image is on root storage"
sudo podman image scp $USER@localhost::$TARGET_IMAGE root@localhost::
fi

echo "Cleaning up previous build"
sudo rm -rf output || true
mkdir -p output
sudo podman run \
--rm \
-it \
--privileged \
--pull=newer \
--security-opt label=type:unconfined_t \
-v $(pwd)/image-builder.config.toml:/config.toml:ro \
-v $(pwd)/output:/output \
-v /var/lib/containers/storage:/var/lib/containers/storage \
quay.io/centos-bootc/bootc-image-builder:latest \
--type {{ type }} \
--rootfs btrfs \
--local \
$TARGET_IMAGE
sudo chown -R $USER:$USER output

0 comments on commit c078eba

Please sign in to comment.