Files
bootc-images/builder.sh
2026-02-21 15:03:14 +01:00

29 lines
813 B
Bash
Executable File

#!/bin/bash
set -euxo pipefail
#todo: make sure all the deps exist???
#todo: dynamic versions
#todo: justfile??????
mkdir -p repo cache
if [[ ! -f "repo/config" ]]; then
pushd repo > /dev/null || exit 1
ostree init --repo . --mode=bare-user
popd > /dev/null || exit 1
fi
ostree --repo=repo config set 'core.fsync' 'false'
buildid="$(date '+%Y%m%d.0')"
timestamp="$(date --iso-8601=sec)"
echo "${buildid}" > .buildid
version="$(rpm-ostree compose tree --print-only --repo=repo ./images/minimal/manifest.yaml | jq -r '."releasever"')"
echo "Composing ${version}.${buildid} ..."
ARGS=(
"--cachedir=cache"
"--initialize"
"--max-layers=96"
)
rpm-ostree compose image "${ARGS[@]}" "./images/minimal/manifest.yaml" "./images/minimal/manifest.ociarchive"