Files
nvfp4-megamoe-kernel/build_and_run.sh
2026-05-14 19:35:39 +00:00

23 lines
562 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")"
# Bust the Docker build cache by injecting a timestamp
TIMESTAMP=$(date +%s)
sed -i -E "s/ARG CACHE_BUSTER=.*/ARG CACHE_BUSTER=${TIMESTAMP}/" Dockerfile
echo "=== Stopping existing container ==="
docker compose down 2>/dev/null || true
echo "=== Building ==="
docker compose build
echo "=== Starting ==="
docker compose up -d
# Restore Dockerfile so git diff stays clean
sed -i -E "s/ARG CACHE_BUSTER=.*/ARG CACHE_BUSTER=\${TIMESTAMP}/" Dockerfile
echo "=== Done. Container: $(docker compose ps -q) ==="