---
title: "Update the configurations of a container"
method: POST
path: "/containers/{id}/update"
tags: ["Container"]
---

# Update the configurations of a container

`POST /containers/{id}/update`

## Path parameters

- `id` string, required

## Request body

- UpdateConfig — A container's resources (cgroups config, ulimits, etc)
  - `CgroupParent` string — Path to `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.
  - `BlkioWeight` integer — Block IO weight (relative weight), need CFQ IO Scheduler enable.
  - `BlkioWeightDevice` WeightDevice[] — Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`.
    - `Path` string — Weight Device
    - `Weight` integer
  - `BlkioDeviceReadBps` ThrottleDevice[] — Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
    - `Path` string — Device path
    - `Rate` integer — Rate
  - `BlkioDeviceWriteBps` ThrottleDevice[] — Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
    - `Path` string — Device path
    - `Rate` integer — Rate
  - `BlkioDeviceReadIOps` ThrottleDevice[] — Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
    - `Path` string — Device path
    - `Rate` integer — Rate
  - `BlkioDeviceWriteIOps` ThrottleDevice[] — Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
    - `Path` string — Device path
    - `Rate` integer — Rate
  - `CpuShares` integer — An integer value representing this container's relative CPU weight versus other containers.
  - `CpuPeriod` integer — CPU CFS (Completely Fair Scheduler) period. The length of a CPU period in microseconds.
  - `CpuQuota` integer — CPU CFS (Completely Fair Scheduler) quota. Microseconds of CPU time that the container can get in a CPU period."
  - `CpuRealtimePeriod` integer — The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks.
  - `CpuRealtimeRuntime` integer — The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks.
  - `CpusetCpus` string — CPUs in which to allow execution (e.g., `0-3`, `0,1`)
  - `CpusetMems` string — Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
  - `Devices` DeviceMapping[] — A list of devices to add to the container.
    - `PathOnHost` string — path on host of the device mapping
    - `PathInContainer` string — path in container of the device mapping
    - `CgroupPermissions` string — cgroup permissions of the device
  - `DeviceCgroupRules` string[] — a list of cgroup rules to apply to the container
  - `KernelMemory` integer — Kernel memory limit in bytes.
  - `Memory` integer — Memory limit in bytes.
  - `MemoryReservation` integer — Memory soft limit in bytes.
  - `MemorySwap` integer — Total memory limit (memory + swap). Set as `-1` to enable unlimited swap.
  - `MemorySwappiness` integer — Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. -1 is also accepted, as a legacy alias of 0.
  - `NanoCpus` integer — CPU quota in units of 10<sup>-9</sup> CPUs.
  - `OomKillDisable` boolean, nullable — Disable OOM Killer for the container.
  - `PidsLimit` integer — Tune a container's pids limit. Set -1 for unlimited. Only on Linux 4.4 does this parameter support.
  - `Ulimits` Ulimit[] — A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`"
    - `Name` string — Name of ulimit
    - `Soft` integer — Soft limit
    - `Hard` integer — Hard limit
  - `CpuCount` integer — The number of usable CPUs (Windows only). On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last.
  - `CpuPercent` integer — The usable percentage of the available CPUs (Windows only). On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last.
  - `IOMaximumIOps` integer — Maximum IOps for the container system drive (Windows only)
  - `IOMaximumBandwidth` integer — Maximum IO in bytes per second for the container system drive (Windows only)
  - `IntelRdtL3Cbm` string — IntelRdtL3Cbm specifies settings for Intel RDT/CAT group that the container is placed into to limit the resources (e.g., L3 cache) the container has available.
  - `ScheLatSwitch` integer — ScheLatSwitch enables scheduler latency count in cpuacct
  - `MemoryWmarkRatio` integer, nullable — MemoryWmarkRatio is an integer value representing this container's memory low water mark percentage. The value of memory low water mark is memory.limit_in_bytes * MemoryWmarkRatio.
  - `MemoryExtra` integer, nullable — MemoryExtra is an integer value representing memory extra in bytes
  - `MemoryForceEmptyCtl` integer — MemoryForceEmptyCtl represents whether to reclaim the page cache when deleting cgroup.
  - `NvidiaConfig` NvidiaConfig
    - `NvidiaVisibleDevices` string — NvidiaVisibleDevices controls which GPUs will be made accessible inside the container
    - `NvidiaDriverCapabilities` string — NvidiaDriverCapabilities controls which driver libraries/binaries will be mounted inside the container
  - `RestartPolicy` RestartPolicy — Define container's restart policy
    - `Name` string
    - `MaximumRetryCount` integer
  - `Env` string[] — A list of environment variables to set inside the container in the form `["VAR=value", ...]`. A variable like "A=" means updating env A in container to be empty value. A variable without `=` is removed from the environment, rather than to have an empty value.
  - `Label` string[] — List of labels set to container.
  - `DiskQuota` object, nullable — update disk quota for container
  - `SpecAnnotation` object, nullable — update specAnnotation for container

## Response `200`

no error

## Other responses

- `400` — bad parameter
- `404` — An unexpected 404 error occurred.
- `500` — An unexpected server error occurred.

---

[API](https://skmtc.dev/aliyun/apis/pouch-engine-api.md) · [All operations](https://skmtc.dev/aliyun/apis/pouch-engine-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/aliyun/pouch-engine-api/revisions/36d75b2825fc/schema)
