Files
source-stack/rockylinux9/build.sh
T
2026-08-13 15:50:03 +08:00

21 lines
503 B
Bash
Executable File

#!/bin/sh
set -eu
IMAGE_NAME="${IMAGE_NAME:-rockylinux9-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"