Stage 02: Base Container Images
Stage 02 builds the shared base Docker images that all service images inherit from. Building base images separately enables faster service builds through Docker layer caching.
Source file: scripts/stages/02-build-base-images.sh
Base Images
| Image | Base | Purpose |
|---|---|---|
matih/base-java:latest | Eclipse Temurin 21 JRE Alpine | Java Spring Boot services |
matih/base-python:latest | Python 3.11 Slim | FastAPI Python services |
matih/base-node:latest | Node.js 20 Alpine | Node.js services |
matih/base-nginx:latest | Nginx 1.25 Alpine | Frontend SPA serving |
Build Process
# Build base images and push to ACR
./scripts/tools/build-base-images.sh
# Each base image is built with multi-arch support
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ${ACR_URL}/matih/base-java:latest \
--push \
infrastructure/docker/base-java/Dependency Verification
The pipeline verifies base images exist before proceeding:
# Check ACR for base image
az acr repository show --name "${ACR_NAME}" \
--image "matih/base-java:latest" &>/dev/null
# Fallback: check local Docker
docker image inspect "matih/base-java:latest" &>/dev/nullDependencies
- Requires:
01-build-setup(Docker buildx configured) - Required by:
03-build-commons(commons need base images for testing)