DOCKER-BUILDX-BAKE(1)
π DOCKER-BUILDX-BAKE(1) π
okay bestie, welcome to docker-buildx-bake, the manual page. yes the title is shouting at you in all caps, that's just how man pages are, they're extra like that. anyway. let's get into it π«Ά
β¨ NAME β¨
docker-buildx-bake β build from a file. that's it. that's the whole name. iconic, brief, no notes. π
πΈ SYNOPSIS πΈ
docker buildx bake [OPTIONS] [TARGET...]
π¦ DESCRIPTION π¦
so Bake is a high-level build command. every target you specify runs in parallel as part of the build. like a little squad all doing their thing at the same time, no waiting around, we love efficiency fr fr β¨
if you wanna actually learn how to write bake files, go read the High-level build options with Bake guide β¨/build/bake/β© β it's the intro, it's giving tutorial energy, it's helpful.
Note π lowkey important: the buildx bake command may receive backwards incompatible features in the future if needed. so like, heads up. they're actively looking for feedback on improving the command and extending the functionality further β so if you have thoughts, they wanna hear them. this is a living, breathing, evolving situation. π
π OPTIONS π
-f,--file=[]β build definition file. point at it, that's your recipe.-h,--help[=false]β help for bake. the classic. the moment you need it, it's there. π--load[=false]β shorthand for--set=*.output=type=docker--metadata-file=""β write build result metadata to the file--no-cache[=false]β do not use cache when building the image. fresh start, no leftovers, we're starting over bestie π--print[=false]β print the options without building. just look. don't touch. window shopping. β¨--progress="auto"β set type of progress output ("auto","plain","tty"). useplainto show container output--provenance=""β shorthand for--set=*.attest=type=provenance--pull[=false]β always attempt to pull all referenced images--push[=false]β shorthand for--set=*.output=type=registry--sbom=""β shorthand for--set=*.attest=type=sbom--set=[]β override target value (e.g.,"targetpattern.key=value")
π OPTIONS INHERITED FROM PARENT COMMANDS π
--builder=""β override the configured builder instance. it's the family trait, inherited, runs in the blood. π§¬
β EXAMPLE β
Override the configured builder instance (--builder) {#builder}
same as [buildx --builder](/reference/cli/docker/buildx/#builder). literally the same thing, just vibing in a different command. π¦
Specify a build definition file (-f, --file) {#file}
use the -f / --file option to specify the build definition file to use. the file can be an HCL, JSON or Compose file. and if you specify multiple files, all of them get read and the build configurations are combined β it's a group project and everyone's contributing. π
you can also pass the names of the targets to build, if you only wanna build specific target(s). the following example builds the db and webapp-release targets that are defined in the docker-bake.dev.hcl file:
# docker-bake.dev.hcl
group "default" {
targets = ["db", "webapp-dev"]
}
target "webapp-dev" {
dockerfile = "Dockerfile.webapp"
tags = ["docker.io/username/webapp"]
}
target "webapp-release" {
inherits = ["webapp-dev"]
platforms = ["linux/amd64", "linux/arm64"]
}
target "db" {
dockerfile = "Dockerfile.db"
tags = ["docker.io/username/db"]
}
$ docker buildx bake -f docker-bake.dev.hcl db webapp-release
see the Bake file reference β¨/build/bake/reference/β© for more details. iykyk π
Don't use cache when building the image (--no-cache) {#no-cache}
same as build --no-cache. don't use cache when building the image. that's the whole thing. no cache. zero. none. π«
Print the options without building (--print) {#print}
prints the resulting options of the targets desired to be built, in a JSON format, without starting a build. it's the "let me see the outfit before i commit" option. obsessed. β¨
$ docker buildx bake -f docker-bake.hcl --print db
{
"group": {
"default": {
"targets": [
"db"
]
}
},
"target": {
"db": {
"context": "./",
"dockerfile": "Dockerfile",
"tags": [
"docker.io/tiborvass/db"
]
}
}
}
Set type of progress output (--progress) {#progress}
same as β¨/reference/cli/docker/buildx/build/#progressβ©. π
Create provenance attestations (--provenance) {#provenance}
same as β¨/reference/cli/docker/buildx/build/#provenanceβ©. π
Always attempt to pull a newer version of the image (--pull) {#pull}
same as build --pull. always chasing the freshest version, main character energy fr π
Create SBOM attestations (--sbom) {#sbom}
same as β¨/reference/cli/docker/buildx/build/#sbomβ©. π¦
Override target configurations from command line (--set) {#set}
--set targetpattern.key[.subkey]=value
override target configurations from command line. the pattern matching syntax is defined in https://golang.org/pkg/path/#Match β go peek if you need the deets.
$ docker buildx bake --set target.args.mybuildarg=value
$ docker buildx bake --set target.platform=linux/arm64
$ docker buildx bake --set foo*.args.mybuildarg=value # overrides build arg for all targets starting with 'foo'
$ docker buildx bake --set *.platform=linux/arm64 # overrides platform for all targets
$ docker buildx bake --set foo*.no-cache # bypass caching only for targets starting with 'foo'
you can override the following fields:
argscache-fromcache-tocontextdockerfilelabelsno-cacheno-cache-filteroutputplatformpullpushsecretssshtagstarget
π₯ SEE ALSO π₯
and that's the whole page bestie!! πβ¨ source/version vibes: Docker Buildx, Apr 2025 β DOCKER-BUILDX-BAKE(1), that's the footer, that's the sign-off, mwah, go build something cute ππ«Άπ
π¦ where this page comes from
- debian trixie: docker-buildx 0.13.1+ds1-3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms