fix: Add post build script to prepare image for ISO creation

This commit is contained in:
Gerald Pinder 2024-09-16 12:14:05 -04:00
parent fbf57e5c83
commit de45aeb015
2 changed files with 13 additions and 1 deletions

11
scripts/post_build.sh Normal file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
if ! command -v bootc; then
rpm-ostree install bootc
fi
bootupctl backend generate-update-metadata
rm -fr /tmp/* /var/*
ostree container commit

View file

@ -38,7 +38,8 @@ RUN --mount=type=bind,from=stage-bins,src=/bins,dst=/tmp/bins \
{% call modules::main_modules_run(recipe.modules_ext, os_version) %}
RUN rm -fr /tmp/* /var/* && ostree container commit
RUN --mount=type=bind,from=ghcr.io/blue-build/cli:{{ exports_tag }}-build-scripts,src=/scripts/,dst=/scripts/ \
/scripts/post_build.sh
# Labels are added last since they cause cache misses with buildah
LABEL {{ blue_build_utils::constants::BUILD_ID_LABEL }}="{{ build_id }}"