Docker Buildx
$ docker-buildx Official Med RiskDocker Buildx (docker-buildx / docker buildx) extends Docker with BuildKit for multi-platform OCI builds, cache mounts, SBOM/provenance attestations, and bake HCL/JSON targets. It writes structured build digests via --metadata-file and inspects remote manifests via imagetools inspect --raw.
brew install docker-buildx docker buildx handles local BuildKit builders, --metadata-file JSON outputs, and multi-arch registry pushes directly on the host.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Emits JSON via --metadata-file, --progress=rawjson, and imagetools inspect --raw, though buildx ls itself outputs text tables.
--metadata-filewrites build result descriptors as JSON--progress=plain/rawjsonavoids TTY spinner redraws
Remote pushes require explicit --push (or --output type=registry), keeping default local builds contained.
- Requires explicit
--pushflag to publish to remote registries - Builds execute arbitrary
RUNsteps defined in Dockerfiles
Available across macOS, Linux, and Windows via Homebrew, Docker Desktop, and GitHub Releases.
- Cross-platform binary and Docker CLI plugin
First-class multi-arch builds, BuildKit layer caching, bake orchestration, and attestation generation.
- Unified multi-platform build, bake, and
imagetoolsworkflow
Official Docker Buildx repository (docker/buildx) licensed under Apache-2.0.
- Official
docker/buildxrepo
Detailed CLI reference and examples at docs.docker.com.
- Official reference at docs.docker.com/reference/cli/docker/buildx/
Security, Auth & Guardrails
Reuses Docker registry auth in ~/.docker/config.json and configured Docker credential helpers.
Apache-2.0 open-source CLI; remote registry storage/egress and Docker Build Cloud usage are billed separately.
# Docker Buildx Agent Rules - Always pass `--progress=plain` (or `rawjson`) and `--metadata-file <path>` on `build` so logs and digests remain parseable. - Never pass `--push` unless registry push is explicitly requested; prefer `--load` or `--output type=oci` for local verification.
Agent-Ready Command Recipes
Safe Read-Only Queries
docker buildx imagetools inspect --raw ghcr.io/org/app:latest
Fetches the raw OCI image index or manifest JSON from a remote registry without pulling layers.
docker buildx ls
Displays active BuildKit drivers, endpoints, and supported target platforms.
Controlled Writes & Previews
docker buildx build --progress=plain --metadata-file build-meta.json --load -t app:dev .
Builds the image into the local Docker store with non-TTY logs and writes the resulting digest/config to build-meta.json.
Strengths for Agents
- +
--metadata-fileemits machine-readable JSON with exact image digests and manifest descriptors. - +
imagetools inspect --rawreads remote multi-arch manifests without a local build. - +
--progress=plainkeeps CI and agent build logs linear and clean.
Caveats & Pitfalls
- ! Commands like
docker buildx lsdo not offer a native--format jsonflag. - ! Multi-platform builds require QEMU/binfmt or a
docker-containerbuilder driver.