buildx_bake
Build multiple Docker targets defined in a bake file (HCL, JSON, or compose) for multi-target builds, with controls for push, load, caching, and per-target overrides.
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 — 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 |