How watonomous/wato_base_images works
Project Type and Purpose
• This is not a full-stack app or microservice mesh but a DevOps toolset: a GitHub-Actions-driven pipeline for building and pushing Docker “base” images (for multiple monorepos) to a container registry.
• The README and file tree show:
• A JSON config (.github/include/base_image_config.json) listing the image definitions
• A reusable GitHub Actions template + shell script (.github/templates/docker_context/*) that reads that config to drive builds
• Two specialized Dockerfiles (inject_ros2.Dockerfile, inject_wato_base.Dockerfile)
• A script to push ARM64 variants (deploy_arm64.sh)
• A workflow (.github/workflows/build_base_images.yml) that ties it all together
Analyzing the File Structure
• Top-level
• README.md explains usage
• inject_*.Dockerfile – image build blueprints
• deploy_arm64.sh – supports ARM64 builds/pushes
• .github/
• workflows/build_base_images.yml – CI pipeline definition
• templates/docker_context – a custom Action plus shell logic for reading the JSON and constructing the Docker build contexts
• include/base_image_config.json – the single source of truth for “which” images to build and tag, and what each one contains
Key Components
a. CONFIGURATION LAYER
– base_image_config.json (defines image names, versions, build args)
– deploy_arm64.sh (for alternate-arch builds)
b. PIPELINE LAYER (GitHub Actions)
– build_base_images workflow
– docker_context composite action (template)
c. BUILD ARTIFACTS
– inject_wato_base.Dockerfile
– inject_ros2.Dockerfile
– generated Docker contexts per image
d. EXTERNAL SERVICES
– Docker daemon (local or GitHub runners)
– Docker Hub (or ghcr.io) registry
Interactions and Data Flow
1. A human or scheduled trigger invokes the “Build Monorepo Base Images” workflow.
2. The workflow reads base_image_config.json via the docker_context Action + docker_context.sh.
3. For each image entry in JSON, the Action:
• populates a temp build context (copies the right Dockerfile + adds config)
• runs docker build (on x86_64 runners) or deploy_arm64.sh (on ARM hardware)
• tags & pushes to the registry
4. The registry holds published images, ready for downstream monorepos.
Architectural Patterns and Principles
• Configuration-driven builds: central JSON → dynamic context generation
• “Pipeline as code”: all steps in GitHub Actions YAML + composite Action
• Modular Dockerfiles: separate concerns (ROS2 vs base)
• Extensibility: new images are just new JSON entries + optional Dockerfile