github.com/khulnasoft/cli@v0.0.0-20240402070845-01bcad7beefa/docs/reference/commandline/builder_build.md (about) 1 # builder build 2 3 <!---MARKER_GEN_START--> 4 Build an image from a Dockerfile 5 6 ### Aliases 7 8 `docker image build`, `docker build`, `docker buildx build`, `docker builder build` 9 10 ### Options 11 12 | Name | Type | Default | Description | 13 |:--------------------------|:--------------|:----------|:------------------------------------------------------------------| 14 | `--add-host` | `list` | | Add a custom host-to-IP mapping (`host:ip`) | 15 | `--build-arg` | `list` | | Set build-time variables | 16 | `--cache-from` | `stringSlice` | | Images to consider as cache sources | 17 | `--cgroup-parent` | `string` | | Set the parent cgroup for the `RUN` instructions during build | 18 | `--compress` | | | Compress the build context using gzip | 19 | `--cpu-period` | `int64` | `0` | Limit the CPU CFS (Completely Fair Scheduler) period | 20 | `--cpu-quota` | `int64` | `0` | Limit the CPU CFS (Completely Fair Scheduler) quota | 21 | `-c`, `--cpu-shares` | `int64` | `0` | CPU shares (relative weight) | 22 | `--cpuset-cpus` | `string` | | CPUs in which to allow execution (0-3, 0,1) | 23 | `--cpuset-mems` | `string` | | MEMs in which to allow execution (0-3, 0,1) | 24 | `--disable-content-trust` | `bool` | `true` | Skip image verification | 25 | `-f`, `--file` | `string` | | Name of the Dockerfile (Default is `PATH/Dockerfile`) | 26 | `--force-rm` | | | Always remove intermediate containers | 27 | `--iidfile` | `string` | | Write the image ID to the file | 28 | `--isolation` | `string` | | Container isolation technology | 29 | `--label` | `list` | | Set metadata for an image | 30 | `-m`, `--memory` | `bytes` | `0` | Memory limit | 31 | `--memory-swap` | `bytes` | `0` | Swap limit equal to memory plus swap: -1 to enable unlimited swap | 32 | `--network` | `string` | `default` | Set the networking mode for the RUN instructions during build | 33 | `--no-cache` | | | Do not use cache when building the image | 34 | `--platform` | `string` | | Set platform if server is multi-platform capable | 35 | `--pull` | | | Always attempt to pull a newer version of the image | 36 | `-q`, `--quiet` | | | Suppress the build output and print image ID on success | 37 | `--rm` | `bool` | `true` | Remove intermediate containers after a successful build | 38 | `--security-opt` | `stringSlice` | | Security options | 39 | `--shm-size` | `bytes` | `0` | Size of `/dev/shm` | 40 | `--squash` | | | Squash newly built layers into a single new layer | 41 | `-t`, `--tag` | `list` | | Name and optionally a tag in the `name:tag` format | 42 | `--target` | `string` | | Set the target build stage to build. | 43 | `--ulimit` | `ulimit` | | Ulimit options | 44 45 46 <!---MARKER_GEN_END--> 47 48 ## Description 49 50 See [docker build](image_build.md) for more information.