buildx_bake
Build multiple Docker targets defined in bake or compose files, using HCL or JSON configs, with options for push, load, and caching. Run all targets in one command and receive detailed output for automated workflows.
Instructions
Build multiple targets defined in a bake file (HCL, JSON, or compose).
Use it for multi-target builds declared in docker-bake.hcl/compose files; for a single
Dockerfile target use buildx_build.
Does not raise on a non-zero CLI exit (a missing buildx plugin or a timeout still raises) - inspect
returncode/stderr in the result.
Args:
targets: Bake targets to build (default: the default group)
files: Bake file paths (-f, repeatable)
set_overrides: Per-target overrides, e.g. ["app.platform=linux/amd64"]
push: Push results to the registry
load: Load results into the local image store
no_cache: Do not use cache when building
pull: Always pull a newer base image
builder: Override the active builder
cwd: Working directory containing the bake file (defaults to the server's cwd; copied to the target host if no
local plugin)
timeout_seconds: Subprocess timeout (default 1800s)
Returns: dict: {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| load | No | ||
| pull | No | ||
| push | No | ||
| files | No | ||
| builder | No | ||
| targets | No | ||
| no_cache | No | ||
| set_overrides | No | ||
| timeout_seconds | No |