Initial commit: Alpine Zero-OS initramfs build system with cleaned Docker configuration
This commit is contained in:
126
build/docker-compose.yml
Normal file
126
build/docker-compose.yml
Normal file
@@ -0,0 +1,126 @@
|
||||
services:
|
||||
# Cached builder using multi-stage Dockerfile
|
||||
builder:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: build/Dockerfile.cached
|
||||
target: final-builder
|
||||
args:
|
||||
BUILDMODE: "${BUILDMODE:-debug}"
|
||||
TARGETARCH: "${TARGETARCH:-amd64}"
|
||||
MINIMAL_MODE: "${MINIMAL_MODE:-false}"
|
||||
image: zero-os-alpine-builder:cached-${BUILDMODE:-debug}
|
||||
container_name: zero-os-alpine-builder-cached
|
||||
privileged: true
|
||||
volumes:
|
||||
# Mount source configs and scripts (read-only for cache efficiency)
|
||||
- ../configs:/build/configs:ro
|
||||
- ../scripts:/build/scripts:ro
|
||||
# Mount output directory
|
||||
- ../output:/build/output
|
||||
# Persistent cache directories for maximum caching
|
||||
- build-cache:/build/cache
|
||||
- source-cache:/build/source
|
||||
- kernel-cache:/build/kernel
|
||||
# Mount existing zinit config from main project
|
||||
- ../configs/zinit:/mnt/zinit:ro
|
||||
environment:
|
||||
- BUILDMODE=${BUILDMODE:-debug}
|
||||
- TARGETARCH=${TARGETARCH:-amd64}
|
||||
- MINIMAL_MODE=${MINIMAL_MODE:-false}
|
||||
working_dir: /build
|
||||
command: ["/build/scripts/build-smart.sh"]
|
||||
|
||||
# Legacy builder for comparison/fallback
|
||||
builder-legacy:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: build/Dockerfile.alpine
|
||||
args:
|
||||
BUILDMODE: "${BUILDMODE:-debug}"
|
||||
TARGETARCH: "${TARGETARCH:-amd64}"
|
||||
MINIMAL_MODE: "${MINIMAL_MODE:-false}"
|
||||
image: zero-os-alpine-builder:legacy
|
||||
container_name: zero-os-alpine-builder-legacy
|
||||
privileged: true
|
||||
volumes:
|
||||
- ../configs:/build/configs:ro
|
||||
- ../scripts:/build/scripts:ro
|
||||
- ../output:/build/output
|
||||
- github-cache:/build/github
|
||||
- kernel-cache-legacy:/build/kernel
|
||||
- ../configs/zinit:/mnt/zinit:ro
|
||||
environment:
|
||||
- BUILDMODE=${BUILDMODE:-debug}
|
||||
- TARGETARCH=${TARGETARCH:-amd64}
|
||||
- MINIMAL_MODE=${MINIMAL_MODE:-false}
|
||||
working_dir: /build
|
||||
command: ["/build/scripts/build-initramfs.sh"]
|
||||
|
||||
# Quick shell access for debugging (uses cached builder)
|
||||
shell:
|
||||
extends: builder
|
||||
container_name: zero-os-alpine-shell
|
||||
command: /bin/sh
|
||||
stdin_open: true
|
||||
tty: true
|
||||
|
||||
# Development shell with full caches
|
||||
dev-shell:
|
||||
extends: builder
|
||||
container_name: zero-os-alpine-dev-shell
|
||||
command: /bin/sh
|
||||
stdin_open: true
|
||||
tty: true
|
||||
volumes:
|
||||
- ../configs:/build/configs
|
||||
- ../scripts:/build/scripts
|
||||
- ../output:/build/output
|
||||
- build-cache:/build/cache
|
||||
- source-cache:/build/source
|
||||
- kernel-cache:/build/kernel
|
||||
- ../configs/zinit:/mnt/zinit:ro
|
||||
|
||||
# Test build with minimal caching (for testing clean builds)
|
||||
test:
|
||||
extends: builder
|
||||
container_name: zero-os-alpine-test
|
||||
volumes:
|
||||
- ../configs:/build/configs:ro
|
||||
- ../scripts:/build/scripts:ro
|
||||
- ../output:/build/output
|
||||
- ../configs/zinit:/mnt/zinit:ro
|
||||
environment:
|
||||
- BUILDMODE=debug
|
||||
- TARGETARCH=amd64
|
||||
- MINIMAL_MODE=${MINIMAL_MODE:-false}
|
||||
|
||||
# Cache management service
|
||||
cache-info:
|
||||
extends: builder
|
||||
container_name: zero-os-alpine-cache-info
|
||||
command: |
|
||||
sh -c "
|
||||
echo 'Build Cache Information:'
|
||||
echo 'Cache directory: /build/cache'
|
||||
ls -la /build/cache/ 2>/dev/null || echo 'No cache markers found'
|
||||
echo ''
|
||||
echo 'Source cache: /build/source'
|
||||
ls -la /build/source/ 2>/dev/null || echo 'No source cache found'
|
||||
echo ''
|
||||
echo 'Kernel cache: /build/kernel'
|
||||
ls -la /build/kernel/ 2>/dev/null || echo 'No kernel cache found'
|
||||
echo ''
|
||||
echo 'Cache sizes:'
|
||||
du -sh /build/cache /build/source /build/kernel 2>/dev/null || true
|
||||
"
|
||||
|
||||
volumes:
|
||||
# New cached volumes
|
||||
build-cache:
|
||||
source-cache:
|
||||
kernel-cache:
|
||||
|
||||
# Legacy volumes (for fallback)
|
||||
github-cache:
|
||||
kernel-cache-legacy:
|
||||
Reference in New Issue
Block a user