/v1.33/buildBuild an image from a tar archive with a `Dockerfile` in it. The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. See the `Dockerfile` reference for more information. The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. The build is canceled if the client drops the connection by quitting or being killed.
Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`.
A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters.
Extra hosts to add to /etc/hosts
A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball.
Suppress verbose build output.
Do not use the cache when building the image.
JSON array of images used for build cache resolution.
Attempt to pull the image even if an older image exists locally.
Remove intermediate containers after a successful build.
Always remove intermediate containers, even upon failure.
Set memory limit for build.
Total memory (memory + swap). Set as `-1` to disable swap.
CPU shares (relative weight).
CPUs in which to allow execution (e.g., `0-3`, `0,1`).
The length of a CPU period in microseconds.
Microseconds of CPU time that the container can get in a CPU period.
JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg)
Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.
Squash the resulting images layers into a single layer. *(Experimental release only.)*
Arbitrary key/value labels to set on the image, as a JSON map of string pairs.
Sets the networking mode for the run commands during build. Supported standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. Any other value is taken as a custom network's name to which this container should connect to.
{
"success": true,
"data": {
"id": "abc123",
"created_at": "2025-01-01T00:00:00Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters"
}
}1curl --request POST \2 --url '/v1.33/build' \3 --header 'accept: application/json' \4 --header 'content-type: application/json'1{2 "success": true,3 "data": {4 "id": "abc123",5 "created_at": "2025-01-01T00:00:00Z"6 }7}/v1.33/buildBuild an image from a tar archive with a `Dockerfile` in it. The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. See the `Dockerfile` reference for more information. The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. The build is canceled if the client drops the connection by quitting or being killed.
Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`.
A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters.
Extra hosts to add to /etc/hosts
A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball.
Suppress verbose build output.
Do not use the cache when building the image.
JSON array of images used for build cache resolution.
Attempt to pull the image even if an older image exists locally.
Remove intermediate containers after a successful build.
Always remove intermediate containers, even upon failure.
Set memory limit for build.
Total memory (memory + swap). Set as `-1` to disable swap.
CPU shares (relative weight).
CPUs in which to allow execution (e.g., `0-3`, `0,1`).
The length of a CPU period in microseconds.
Microseconds of CPU time that the container can get in a CPU period.
JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg)
Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.
Squash the resulting images layers into a single layer. *(Experimental release only.)*
Arbitrary key/value labels to set on the image, as a JSON map of string pairs.
Sets the networking mode for the run commands during build. Supported standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. Any other value is taken as a custom network's name to which this container should connect to.
{
"success": true,
"data": {
"id": "abc123",
"created_at": "2025-01-01T00:00:00Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters"
}
}1curl --request POST \2 --url '/v1.33/build' \3 --header 'accept: application/json' \4 --header 'content-type: application/json'1{2 "success": true,3 "data": {4 "id": "abc123",5 "created_at": "2025-01-01T00:00:00Z"6 }7}