archy/image-recipe/build-macos.sh
Dorian ba1a7bd3f6 Enhance README and build scripts for hardware-specific optimizations
- Updated README.md to clarify development setup for macOS/Docker and added production build instructions for specific hardware.
- Introduced new build scripts for optimized OS images targeting Start9 Server Pure, HP ProDesk 400 G4 DM, and Dell OptiPlex.
- Enhanced Dockerfile to specify platform compatibility and improved Alpine profile for Archipelago builds.
- Updated configuration files and init scripts to support new hardware profiles and ensure proper service management.
2026-01-31 19:47:52 +00:00

58 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# macOS build wrapper using Docker
# Builds Alpine image in Docker container
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
BUILD_TYPE="${1:-iso}"
echo "🍎 Building on macOS via Docker"
echo ""
# Check for Docker
if ! command -v docker >/dev/null 2>&1; then
echo "❌ Docker not found. Install Docker Desktop: https://www.docker.com/products/docker-desktop"
exit 1
fi
if ! docker info >/dev/null 2>&1; then
echo "❌ Docker daemon not running. Start Docker Desktop."
exit 1
fi
# Build Docker image if needed
echo "🔨 Building Docker build image..."
docker build -f "$SCRIPT_DIR/Dockerfile.build" -t archipelago-builder:latest "$SCRIPT_DIR" || {
echo "❌ Docker image build failed"
exit 1
}
# Run build in container
echo "🚀 Running build in container..."
echo " This may take 30-60 minutes on first build..."
echo ""
# Check if running in TTY
if [ -t 0 ]; then
DOCKER_FLAGS="-it"
else
DOCKER_FLAGS="-t"
fi
docker run --rm $DOCKER_FLAGS \
-v "$PROJECT_ROOT:/workspace" \
-v "$SCRIPT_DIR/results:/results" \
-v "$SCRIPT_DIR/build:/build" \
-v "$SCRIPT_DIR/apks:/apks" \
-e BUILD_TYPE="$BUILD_TYPE" \
-e ARCHIPELAGO_VERSION="${ARCHIPELAGO_VERSION:-0.1.0}" \
-e ALPINE_VERSION="${ALPINE_VERSION:-3.19}" \
-e ARCH="${ARCH:-x86_64}" \
archipelago-builder:latest \
sh -c "cd /workspace/image-recipe && ./build-linux.sh $BUILD_TYPE"
echo ""
echo "✅ Build complete! Check results/ directory"