build_image
Build a Docker image from a Dockerfile using the classic builder. Specify the build context directory and tag, with options to control caching, pull, and resource limits.
Instructions
Build an image from a Dockerfile using the daemon's classic builder.
Use this for simple single-platform builds from a local context. For multi-platform
builds, BuildKit cache export/import, or advanced build features prefer buildx_build.
path must be a directory accessible on the host running this server (it is the build
context sent to the daemon). dockerfile is relative to path; omit to use the
default Dockerfile.
args:
path - Build context directory path on the server host
tag - Name and optional tag in "name:tag" format to apply to the built image
quiet - Suppress verbose build output (final image id still returned)
nocache - Ignore the layer cache and rebuild all layers
rm - Remove intermediate containers on success (default True)
pull - Always pull a newer version of each FROM base image before building
forcerm - Remove intermediate containers even on build failure
dockerfile - Dockerfile filename relative to path (default: "Dockerfile")
buildargs - Build-time variables passed as --build-arg; dict of str→str
container_limits - Resource limits for the build container, e.g. {"memory": 134217728}
shmsize - Size of /dev/shm in bytes for build steps that need shared memory
labels - Labels to apply to the resulting image; dict of str→str
cache_from - List of image references to use as layer cache sources
target - Stop at this named build stage (multi-stage Dockerfiles)
network_mode - Network mode for RUN instructions during build (e.g. "host", "none")
squash - Squash all new layers into one (experimental; requires daemon flag)
extra_hosts - Additional /etc/hosts entries during build; dict of hostname→ip
platform - Target platform, e.g. "linux/amd64" (single platform only; use buildx for multi)
isolation - Windows isolation technology ("default", "process", "hyperv")
use_config_proxy - Forward proxy env vars from Docker client config to build
returns: dict - The built image's attrs
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rm | No | ||
| tag | No | ||
| path | No | ||
| pull | No | ||
| quiet | No | ||
| labels | No | ||
| squash | No | ||
| target | No | ||
| forcerm | No | ||
| nocache | No | ||
| shmsize | No | ||
| platform | No | ||
| buildargs | No | ||
| isolation | No | ||
| cache_from | No | ||
| dockerfile | No | ||
| extra_hosts | No | ||
| network_mode | No | ||
| container_limits | No | ||
| use_config_proxy | No |