27 lines
761 B
Bash
Executable File
27 lines
761 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
IMAGE_NAME="khos-builder"
|
|
OUTPUT_DIR="$(pwd)/build/output"
|
|
|
|
echo "Building Docker image ${IMAGE_NAME}..."
|
|
docker build -t "${IMAGE_NAME}" .
|
|
|
|
echo "Creating output directory: ${OUTPUT_DIR}"
|
|
mkdir -p "${OUTPUT_DIR}"
|
|
|
|
echo "Running build container (with --privileged)..."
|
|
# We need --privileged for loop devices, mount, and other root operations inside the containe
|
|
docker run --rm -it --privileged \
|
|
-v "${OUTPUT_DIR}:/build/build/output" \
|
|
"${IMAGE_NAME}"
|
|
|
|
echo ""
|
|
echo "Build container finished."
|
|
if ls "${OUTPUT_DIR}"/*.iso 1> /dev/null 2>&1; then
|
|
echo "Success! ISO file(s) available in: ${OUTPUT_DIR}"
|
|
ls -lh "${OUTPUT_DIR}"/*.iso
|
|
else
|
|
echo "No ISO file found in output directory. Check the build logs."
|
|
fi
|