Build an image
/v1.33
/v1.33
/v1.33
/v1.33
POST
/build
Image
Dockerfile
in it.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.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.Request Request Example
Shell
JavaScript
Java
Swift
Response Response Example
200 - Example 1
{}
Request
Query Params
dockerfile
string
optional
Dockerfile
. This is ignored if remote
is specified and points to an external Dockerfile
.t
string
optional
name:tag
format. If you omit the tag the default latest
value is assumed. You can provide several t
parameters.extrahosts
string
optional
remote
string
optional
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.q
string
optional
nocache
string
optional
cachefrom
string
optional
pull
string
optional
rm
string
optional
forcerm
string
optional
memory
integer
optional
memswap
integer
optional
-1
to disable swap.cpushares
integer
optional
cpusetcpus
string
optional
0-3
, 0,1
).cpuperiod
integer
optional
cpuquota
integer
optional
buildargs
integer
optional
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.shmsize
integer
optional
/dev/shm
in bytes. The size must be greater than 0. If omitted the system uses 64MB.squash
string
optional
labels
string
optional
networkmode
string
optional
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.Header Params
Content-type
string
optional
X-Registry-Config
string
optional
{
"docker.example.com": {
"username": "janedoe",
"password": "hunter2"
},
"https://index.docker.io/v1/": {
"username": "mobydock",
"password": "conta1n3rize14"
}
}
https://
prefix and a /v1/
suffix even though Docker will prefer to use the v2 registry API.Body Params application/octet-stream
Not configured
Responses
Modified at 2022-09-10 17:56:06