DOCKER(1)
β¨ NAME β¨
docker-builder-build β build an image from a Dockerfile π«Ά
(and yes bestie, this is a page from the Docker User Manuals set, filed under DOCKER(1) β you're in the right place, come sit with me π)
πΈ SYNOPSIS πΈ
docker builder build [OPTIONS] PATH | URL | -
π DESCRIPTION π
okay so. this command builds an image from a Dockerfile. that's it, that's the whole vibe. you point it at a build context β a PATH, a URL, or - for stdin β and it goes off and makes you an image. main character energy fr fr π
π OPTIONS π
so many flags. literally so many. let's go one by one, no skipping, periodt:
--add-host=β add a custom host-to-IP mapping, written as"host:ip". lowkey essential when you need a name to resolve to a specific address.--build-arg=β set build-time variables. like env vars but just for the build, iykyk.--cache-from=[]β images to consider as cache sources. yes queen, reuse that cache.--cgroup-parent=""β set the parent cgroup for the"RUN"instructions during build.--compress[=false]β compress the build context using gzip. defaults to false.--cpu-period=0β limit the CPU CFS (Completely Fair Scheduler) period.--cpu-quota=0β limit the CPU CFS (Completely Fair Scheduler) quota.-c,--cpu-shares=0β CPU shares (relative weight).--cpuset-cpus=""β CPUs in which to allow execution, like0-3or0,1.--cpuset-mems=""β MEMs in which to allow execution, like0-3or0,1.-f,--file=""β name of the Dockerfile (default is"PATH/Dockerfile").--force-rm[=false]β always remove intermediate containers. no leftovers, we love a clean room π§Ή--iidfile=""β write the image ID to the file. handy for scripts!--isolation=""β container isolation technology.--label=β set metadata for an image. cute lil name tags π·οΈ-m,--memory=0β memory limit.--memory-swap=0β swap limit equal to memory plus swap:-1to enable unlimited swap.--network="default"β set the networking mode for theRUNinstructions during build.--no-cache[=false]β do not use cache when building the image. fresh start energy β¨--platform=""β set platform if server is multi-platform capable.--pull[=false]β always attempt to pull a newer version of the image.-q,--quiet[=false]β suppress the build output and print image ID on success. the strong silent type π--rm[=true]β remove intermediate containers after a successful build. (on by default, bestie β note thetrue)--security-opt=[]β security options.--shm-size=0β size of"/dev/shm".--squash[=false]β squash newly built layers into a single new layer.-t,--tag=β name and optionally a tag in the"name:tag"format.--target=""β set the target build stage to build.--ulimit=[]β Ulimit options.
π¦ SEE ALSO π¦
ngl, if you're ever lost, just run it with --help and vibe check your way through. you got this π
mwah π that's the whole page! brought to you by the Docker Community, dated Oct 2026 β thanks for reading all the way to the bottom, you're literally iconic for that ππΈ
π¦ where this page comes from
- alpine 3.24: docker-doc 29.9.2-r0 Β· Apache-2.0
- fedora 43: docker-cli 29.8.2-2.fc43
- fedora 43: docker-cli 29.9.2-2.fc43 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT
- fedora 44: docker-cli 29.8.2-2.fc44
- fedora 44: docker-cli 29.9.2-2.fc44 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT
- opensuse-leap 16.0: docker 29.7.2_ce-160000.8.1 Β· Apache-2.0
- opensuse-leap 16.0: docker 29.7.2_ce-160000.8.1 Β· Apache-2.0
- opensuse-leap 16.0: docker 29.7.2_ce-160000.8.1 Β· Apache-2.0
- opensuse-leap 16.0: docker 29.7.2_ce-160000.8.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms