# subhransu-de/docker-bake architecture

> Architecture diagram of the GitHub repository subhransu-de/docker-bake, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/subhransu-de/docker-bake
- Repository: https://github.com/subhransu-de/docker-bake

## Overview

##### Project type and purpose
- This is an example/demo project (from the README) illustrating how to use Docker Bake (a higher-level orchestration tool built on top of BuildKit) to produce multi-platform Docker images.
- It includes:
- A minimal Node.js application (index.js, package.json)
- Dockerfile (single‐stage/container definition)
- A Docker Bake configuration (docker-bake.hcl)
- A GitHub Actions CI/CD pipeline (.github/workflows/docker-bake-pipeline.yml) that builds and verifies multi-arch images.

##### File structure
- Top-level application files:
- index.js
- package.json, package-lock.json
- Container build files:
- Dockerfile
- docker-bake.hcl (defines Bake targets, platforms, contexts)
- CI/CD:
- .github/workflows/docker-bake-pipeline.yml
- Supporting files:
- .dockerignore, .gitignore
- docker-bake.hcl for high-level build orchestration

##### README for additional insights
- Confirms purpose: demo of Docker Bake multi-platform build
- Mentions CI/CD integration via GitHub Actions workflow

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Repository"
        Repo["GitHub Repository"]:::source
        README["README.md"]:::source
        Gitignore[".gitignore"]:::source
        Code1["index.js"]:::source
        Code2["package.json"]:::source
        Code3["package-lock.json"]:::source
        Dockerfile["Dockerfile"]:::source
        Dockerignore[".dockerignore"]:::source
        BakeConfig["docker-bake.hcl"]:::source
        Workflow[".github/workflows/docker-bake-pipeline.yml"]:::cicd
    end

    subgraph "CI/CD Pipeline"
        Runner["GitHub Actions Runner"]:::cicd
        Bake["Docker Bake (docker-bake.hcl)"]:::cicd
    end

    subgraph "Build Engines"
        BuildKit["Docker BuildKit"]:::build
        subgraph "Target Platforms"
            Plat1["linux/amd64"]:::build
            Plat2["linux/arm64"]:::build
        end
    end

    Registry["Docker Registry"]:::external
    Consumer["End User"]:::external
    Developer["Developer"]:::external

    Developer -->|"push code"| Repo
    Repo -->|"trigger workflow"| Runner
    Runner -->|"checkout code"| Repo
    Runner -->|"invoke Docker Bake"| Bake
    Bake -->|"orchestrate builds"| BuildKit
    BuildKit -->|"build on"| Plat1
    BuildKit -->|"build on"| Plat2
    Plat1 -->|"push image"| Registry
    Plat2 -->|"push image"| Registry
    Registry -->|"pull image"| Consumer

    click Code1 "https://github.com/subhransu-de/docker-bake/blob/main/index.js"
    click Code2 "https://github.com/subhransu-de/docker-bake/blob/main/package.json"
    click Code3 "https://github.com/subhransu-de/docker-bake/blob/main/package-lock.json"
    click Dockerfile "https://github.com/subhransu-de/docker-bake/tree/main/Dockerfile"
    click Dockerignore "https://github.com/subhransu-de/docker-bake/blob/main/.dockerignore"
    click BakeConfig "https://github.com/subhransu-de/docker-bake/blob/main/docker-bake.hcl"
    click Workflow "https://github.com/subhransu-de/docker-bake/blob/main/.github/workflows/docker-bake-pipeline.yml"
    click README "https://github.com/subhransu-de/docker-bake/blob/main/README.md"
    click Gitignore "https://github.com/subhransu-de/docker-bake/blob/main/.gitignore"

    classDef source fill:#e0f7fa,stroke:#006064,color:#006064;
    classDef cicd fill:#ffe082,stroke:#f57f17,color:#f57f17;
    classDef build fill:#c8e6c9,stroke:#2e7d32,color:#2e7d32;
    classDef external fill:#f8bbd0,stroke:#880e4f,color:#880e4f;
```
