---
name: "docker-buildx-bake-matrix"
description: "Build and push multi-architecture (linux/amd64, linux/arm64) images in parallel using Buildx Bake."
metadata:
  author: "Docker"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "setup docker buildx multiarch"
  - "configure docker-bake.hcl"
  - "cache buildx to remote registry"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Docker Buildx Bake Multi-Platform Build Matrices

Configures BuildKit and Docker Buildx Bake: declaring targets in docker-bake.hcl, matrix builds across architectures, remote registry cache backends (type=registry,mode=max), and GitHub Actions buildx integration.

## When to Invoke
Invoke this skill whenever you need to:
- setup docker buildx multiarch
- configure docker-bake.hcl
- cache buildx to remote registry

## Execution SOP & Rules
1. Install buildx builder: docker buildx create --use --name multi-builder --driver docker-container.
2. Define docker-bake.hcl declaring target groups, platforms = ['linux/amd64', 'linux/arm64'].
3. Configure cache-to = ['type=registry,ref=repo/cache:latest,mode=max'] for remote layer reuse.
4. Execute docker buildx bake --push to build and publish manifests to container registries.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
