diff --git a/image-builder.config.toml b/image-builder.config.toml new file mode 100644 index 0000000..32425de --- /dev/null +++ b/image-builder.config.toml @@ -0,0 +1,8 @@ +[[customizations.user]] +name = "ultramarine" +password = "ultramarine" +groups = ["wheel"] + +[[customizations.filesystem]] +mountpoint = "/" +minsize = "20 GiB" diff --git a/justfile b/justfile index 72705ea..bb41412 100644 --- a/justfile +++ b/justfile @@ -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