Files
source-stack/rocky9/build.sh
T
2026-09-15 12:09:19 +08:00

21 lines
498 B
Bash
Executable File

#!/bin/sh
set -eu
IMAGE_NAME="${IMAGE_NAME:-rocky9-source-stack}"
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
if [ -n "${CONTAINER_ENGINE:-}" ]; then
ENGINE=$CONTAINER_ENGINE
elif command -v docker >/dev/null 2>&1; then
ENGINE=docker
elif command -v podman >/dev/null 2>&1; then
ENGINE=podman
else
echo "Error: Docker or Podman is required." >&2
exit 1
fi
echo "Building image $IMAGE_NAME with $ENGINE ..."
exec "$ENGINE" build --tag "$IMAGE_NAME" "$SCRIPT_DIR"