-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from tulilirockz/justfile-w-bootc-image-builder
feat(just): add bootc-image-builder step + use buildah for build
- Loading branch information
Showing
2 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |