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, like 0-3 or 0,1.
  • --cpuset-mems="" β€” MEMs in which to allow execution, like 0-3 or 0,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: -1 to enable unlimited swap.
  • --network="default" β€” set the networking mode for the RUN instructions 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 the true)
  • --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