perf: split claude-dev into base and runtime images for faster builds
- Create Dockerfile.base with all tools and dependencies (built once) - Slim down Dockerfile to just copy scripts from base image - CI checks for base image existence, builds if missing - Runtime builds drop from ~17min to ~10sec (only copies scripts) - Base image only needs rebuild when tools/versions change
This commit is contained in:
@@ -47,6 +47,18 @@ jobs:
|
||||
if: env.ROLLBACK_ONLY == '0'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# Check if base image exists, build if missing
|
||||
if ! docker image inspect claude-dev-base:latest >/dev/null 2>&1; then
|
||||
echo "Base image not found, building claude-dev-base:latest..."
|
||||
DOCKER_BUILDKIT=0 docker build \
|
||||
-f claude-dev/Dockerfile.base \
|
||||
-t claude-dev-base:latest \
|
||||
claude-dev/
|
||||
else
|
||||
echo "Using existing claude-dev-base:latest"
|
||||
fi
|
||||
|
||||
# Build runtime image (fast, just copies scripts)
|
||||
DOCKER_BUILDKIT=0 docker build \
|
||||
--cache-from claude-dev:latest \
|
||||
-t "$CLAUDE_DEV_IMAGE" \
|
||||
|
||||
Reference in New Issue
Block a user