56 lines
1.8 KiB
YAML
56 lines
1.8 KiB
YAML
# Docker Compose for building agent-browser
|
|
# Usage: docker compose -f docker/docker-compose.yml run build-linux
|
|
#
|
|
# Note: macOS builds should be done natively on macOS for compatibility.
|
|
# Windows uses Node.js fallback (Unix sockets not supported).
|
|
|
|
services:
|
|
# Build for Linux platforms only (macOS should be built natively)
|
|
build-linux:
|
|
build:
|
|
context: ..
|
|
dockerfile: docker/Dockerfile.build
|
|
volumes:
|
|
- ../cli:/build
|
|
- ../bin:/output
|
|
command: |
|
|
-c '
|
|
set -e
|
|
echo "Building for Linux platforms..."
|
|
|
|
# Linux x64
|
|
echo "→ Linux x64"
|
|
cargo zigbuild --release --target x86_64-unknown-linux-gnu
|
|
cp /build/target/x86_64-unknown-linux-gnu/release/agent-browser /output/agent-browser-linux-x64
|
|
chmod +x /output/agent-browser-linux-x64
|
|
|
|
# Linux ARM64
|
|
echo "→ Linux ARM64"
|
|
cargo zigbuild --release --target aarch64-unknown-linux-gnu
|
|
cp /build/target/aarch64-unknown-linux-gnu/release/agent-browser /output/agent-browser-linux-arm64
|
|
chmod +x /output/agent-browser-linux-arm64
|
|
|
|
echo ""
|
|
echo "✓ Linux platforms built successfully!"
|
|
ls -la /output/agent-browser-linux-*
|
|
'
|
|
|
|
# Build for a single target (override with TARGET env var)
|
|
build-single:
|
|
build:
|
|
context: ..
|
|
dockerfile: docker/Dockerfile.build
|
|
volumes:
|
|
- ../cli:/build
|
|
- ../bin:/output
|
|
environment:
|
|
- TARGET=${TARGET:-x86_64-unknown-linux-gnu}
|
|
- OUTPUT_NAME=${OUTPUT_NAME:-agent-browser-linux-x64}
|
|
command: |
|
|
-c '
|
|
cargo zigbuild --release --target $TARGET
|
|
cp /build/target/$TARGET/release/agent-browser* /output/$OUTPUT_NAME
|
|
chmod +x /output/$OUTPUT_NAME 2>/dev/null || true
|
|
echo "✓ Built $OUTPUT_NAME"
|
|
'
|