- System
- Image
- Config
- Container
- Create a containerPOST
- List containersGET
- Delete stopped containersPOST
- Remove a containerDELETE
- Get an archive of a filesystem resource in a containerGET
- Get information about files in a containerHEAD
- Extract an archive of files or folders to a directory in a containerPUT
- Attach to a containerPOST
- Attach to a container via a websocketGET
- Get changes on a container’s filesystemGET
- Export a containerGET
- Inspect a containerGET
- Kill a containerPOST
- Get container logsGET
- Pause a containerPOST
- Rename a containerPOST
- Resize a container TTYPOST
- Restart a containerPOST
- Start a containerPOST
- Get container stats based on resource usageGET
- Stop a containerPOST
- List processes running inside a containerGET
- Unpause a containerPOST
- Update a containerPOST
- Wait for a containerPOST
- Exec
- Distribution
- Network
- Node
- Plugin
- Secret
- Service
- Session (experimental)
- Swarm
- Task
- Volume
- Get task logsGET
Update a container
/v1.33
/v1.33
/v1.33
/v1.33
POST
/containers/{id}/update
Container
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/v1.33/containers//update' \
--header 'Content-Type: application/json' \
--data-raw '{
"BlkioWeight": 300,
"CpuPeriod": 100000,
"CpuQuota": 50000,
"CpuRealtimePeriod": 1000000,
"CpuRealtimeRuntime": 10000,
"CpuShares": 512,
"CpusetCpus": "0,1",
"CpusetMems": "0",
"KernelMemory": 52428800,
"Memory": 314572800,
"MemoryReservation": 209715200,
"MemorySwap": 514288000,
"RestartPolicy": {
"MaximumRetryCount": 4,
"Name": "on-failure"
}
}'
Response Response Example
200 - Example 1
{
"Warnings": [
"string"
]
}
Request
Path Params
id
string
required
Body Params application/json
A container's resources (cgroups config, ulimits, etc)
BlkioDeviceReadBps
array[object (ThrottleDevice) {2}]
optional
[{"Path": "device_path", "Rate": rate}]
.Path
string
optional
Rate
integer <int64>
optional
>= 0
BlkioDeviceReadIOps
array[object (ThrottleDevice) {2}]
optional
[{"Path": "device_path", "Rate": rate}]
.Path
string
optional
Rate
integer <int64>
optional
>= 0
BlkioDeviceWriteBps
array[object (ThrottleDevice) {2}]
optional
[{"Path": "device_path", "Rate": rate}]
.Path
string
optional
Rate
integer <int64>
optional
>= 0
BlkioDeviceWriteIOps
array[object (ThrottleDevice) {2}]
optional
[{"Path": "device_path", "Rate": rate}]
.Path
string
optional
Rate
integer <int64>
optional
>= 0
BlkioWeight
integer
optional
>= 0<= 1000
BlkioWeightDevice
array [object {2}]
optional
[{"Path": "device_path", "Weight": weight}]
.Path
string
optional
Weight
integer
optional
>= 0
CgroupParent
string
optional
cgroups
under which the container's cgroup
is created. If the path is not absolute, the path is considered to be relative to the cgroups
path of the init process. Cgroups are created if they do not already exist.CpuCount
integer <int64>
optional
CPUCount
first, then CPUShares
, and CPUPercent
last.CpuPercent
integer <int64>
optional
CPUCount
first, then CPUShares
, and CPUPercent
last.CpuPeriod
integer <int64>
optional
CpuQuota
integer <int64>
optional
CpuRealtimePeriod
integer <int64>
optional
CpuRealtimeRuntime
integer <int64>
optional
CpuShares
integer
optional
CpusetCpus
string
optional
0-3
, 0,1
)Example:
0-3
CpusetMems
string
optional
DeviceCgroupRules
array[string]
optional
Devices
array[object (DeviceMapping) {3}]
optional
CgroupPermissions
string
optional
PathInContainer
string
optional
PathOnHost
string
optional
DiskQuota
integer <int64>
optional
IOMaximumBandwidth
integer <int64>
optional
IOMaximumIOps
integer <int64>
optional
KernelMemory
integer <int64>
optional
Memory
integer
optional
Default:
0
MemoryReservation
integer <int64>
optional
MemorySwap
integer <int64>
optional
-1
to enable unlimited swap.MemorySwappiness
integer <int64>
optional
>= 0<= 100
NanoCPUs
integer <int64>
optional
OomKillDisable
boolean
optional
PidsLimit
integer <int64>
optional
Ulimits
array [object {3}]
optional
{"Name": "nofile", "Soft": 1024, "Hard": 2048}
"Hard
integer
optional
Name
string
optional
Soft
integer
optional
RestartPolicy
object
RestartPolicy
MaximumRetryCount
integer
optional
on-failure
is used, the number of times to retry before giving upName
enum<string>
optional
always
Always restartunless-stopped
Restart always except when the user has manually stopped the containeron-failure
Restart only when the container exit code is non-zeroAllowed values:
alwaysunless-stoppedon-failure
Examples
Responses
🟢200The container has been updated.
application/json
Body
Warnings
array[string]
optional
🟠404no such container
🔴500server error
Modified at 2022-09-10 17:56:06