v1
latestSwagger 2.02026-07-175684145.0 KBContainer
Create a container
post/containers/create
Query parameters
namestring
Assign the specified name to the container. Must match /?[a-zA-Z0-9_-]+.
Request body
Example request
{
"HostConfig": {
"PortBindings": {
"443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "4443"
}
],
"80/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "80"
},
{
"HostIp": "0.0.0.0",
"HostPort": "8080"
}
],
"80/udp": [
{
"HostIp": "0.0.0.0",
"HostPort": "80"
}
],
"2377/tcp": null
},
"CpusetCpus": "0-3",
"Devices": [
{
"PathOnHost": "/dev/deviceName",
"PathInContainer": "/dev/deviceName",
"CgroupPermissions": "mrw"
}
],
"DeviceCgroupRules": [
"c 13:* rwm"
],
"NvidiaConfig": {
"NvidiaVisibleDevices": "Possible values.\n0,1,2, GPU-fef8089b …: a comma-separated list of GPU UUID(s) or index(es).\nall: all GPUs will be accessible, this is the default value in our container images.\nnone: no GPU will be accessible, but driver capabilities will be enabled.\n",
"NvidiaDriverCapabilities": "Possible values\ncompute,video, graphics,utility …: a comma-separated list of driver features the container needs.\nall: enable all available driver capabilities.\n"
}
}
}Response
Container created successfully