Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(just): add bootc-image-builder step + use buildah for build #6

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading