Search or ask Docker

Resources

Resources schema in Docker Engine API 1.57.

View Markdown

Schema

Type: object

A container's resources (cgroups config, ulimits, etc)
BlkioDeviceReadBps

Type: array

Limit read rate (bytes per second) from a device, in the form:

[{"Path": "device_path", "Rate": rate}]
Array item

Schema: ThrottleDevice

All schema constraints and annotations
{
  "description": "Limit read rate (bytes per second) from a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n",
  "items": {
    "$ref": "#/components/schemas/ThrottleDevice"
  },
  "type": "array"
}
BlkioDeviceReadIOps

Type: array

Limit read rate (IO per second) from a device, in the form:

[{"Path": "device_path", "Rate": rate}]
Array item

Schema: ThrottleDevice

All schema constraints and annotations
{
  "description": "Limit read rate (IO per second) from a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n",
  "items": {
    "$ref": "#/components/schemas/ThrottleDevice"
  },
  "type": "array"
}
BlkioDeviceWriteBps

Type: array

Limit write rate (bytes per second) to a device, in the form:

[{"Path": "device_path", "Rate": rate}]
Array item

Schema: ThrottleDevice

All schema constraints and annotations
{
  "description": "Limit write rate (bytes per second) to a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n",
  "items": {
    "$ref": "#/components/schemas/ThrottleDevice"
  },
  "type": "array"
}
BlkioDeviceWriteIOps

Type: array

Limit write rate (IO per second) to a device, in the form:

[{"Path": "device_path", "Rate": rate}]
Array item

Schema: ThrottleDevice

All schema constraints and annotations
{
  "description": "Limit write rate (IO per second) to a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n",
  "items": {
    "$ref": "#/components/schemas/ThrottleDevice"
  },
  "type": "array"
}
BlkioWeight

Type: integer

Block IO weight (relative weight).
All schema constraints and annotations
{
  "description": "Block IO weight (relative weight).",
  "maximum": 1000,
  "minimum": 0,
  "type": "integer"
}
BlkioWeightDevice

Type: array

Block IO weight (relative device weight) in the form:

[{"Path": "device_path", "Weight": weight}]
Array item

Type: object

Path

Type: string

All schema constraints and annotations
{
  "type": "string"
}
Weight

Type: integer

All schema constraints and annotations
{
  "minimum": 0,
  "type": "integer"
}
All schema constraints and annotations
{
  "properties": {
    "Path": {
      "type": "string"
    },
    "Weight": {
      "minimum": 0,
      "type": "integer"
    }
  },
  "type": "object"
}
All schema constraints and annotations
{
  "description": "Block IO weight (relative device weight) in the form:\n\n```\n[{\"Path\": \"device_path\", \"Weight\": weight}]\n```\n",
  "items": {
    "properties": {
      "Path": {
        "type": "string"
      },
      "Weight": {
        "minimum": 0,
        "type": "integer"
      }
    },
    "type": "object"
  },
  "type": "array"
}
CgroupParent

Type: 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.
All schema constraints and annotations
{
  "description": "Path to `cgroups` under which the container's `cgroup` is created. If\nthe path is not absolute, the path is considered to be relative to the\n`cgroups` path of the init process. Cgroups are created if they do not\nalready exist.\n",
  "type": "string"
}
CpuCount

Type: 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.

All schema constraints and annotations
{
  "description": "The number of usable CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are\nmutually exclusive. The order of precedence is `CPUCount` first, then\n`CPUShares`, and `CPUPercent` last.\n",
  "format": "int64",
  "type": "integer"
}
CpuPercent

Type: 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.

All schema constraints and annotations
{
  "description": "The usable percentage of the available CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are\nmutually exclusive. The order of precedence is `CPUCount` first, then\n`CPUShares`, and `CPUPercent` last.\n",
  "format": "int64",
  "type": "integer"
}
CpuPeriod

Type: integer

The length of a CPU period in microseconds.
All schema constraints and annotations
{
  "description": "The length of a CPU period in microseconds.",
  "format": "int64",
  "type": "integer"
}
CpuQuota

Type: integer

Microseconds of CPU time that the container can get in a CPU period.
All schema constraints and annotations
{
  "description": "Microseconds of CPU time that the container can get in a CPU period.\n",
  "format": "int64",
  "type": "integer"
}
CpuRealtimePeriod

Type: integer

The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks.
All schema constraints and annotations
{
  "description": "The length of a CPU real-time period in microseconds. Set to 0 to\nallocate no time allocated to real-time tasks.\n",
  "format": "int64",
  "type": "integer"
}
CpuRealtimeRuntime

Type: integer

The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks.
All schema constraints and annotations
{
  "description": "The length of a CPU real-time runtime in microseconds. Set to 0 to\nallocate no time allocated to real-time tasks.\n",
  "format": "int64",
  "type": "integer"
}
CpuShares

Type: integer

An integer value representing this container's relative CPU weight versus other containers.
All schema constraints and annotations
{
  "description": "An integer value representing this container's relative CPU weight\nversus other containers.\n",
  "type": "integer"
}
CpusetCpus

Type: string

CPUs in which to allow execution (e.g., 0-3, 0,1).
All schema constraints and annotations
{
  "description": "CPUs in which to allow execution (e.g., `0-3`, `0,1`).\n",
  "example": "0-3",
  "type": "string"
}
CpusetMems

Type: string

Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
All schema constraints and annotations
{
  "description": "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only\neffective on NUMA systems.\n",
  "type": "string"
}
DeviceCgroupRules

Type: array

a list of cgroup rules to apply to the container
Array item

Type: string

All schema constraints and annotations
{
  "example": "c 13:* rwm",
  "type": "string"
}
All schema constraints and annotations
{
  "description": "a list of cgroup rules to apply to the container",
  "items": {
    "example": "c 13:* rwm",
    "type": "string"
  },
  "type": "array"
}
DeviceRequests

Type: array

A list of requests for devices to be sent to device drivers.
Array item

Schema: DeviceRequest

All schema constraints and annotations
{
  "description": "A list of requests for devices to be sent to device drivers.\n",
  "items": {
    "$ref": "#/components/schemas/DeviceRequest"
  },
  "type": "array"
}
Devices

Type: array

A list of devices to add to the container.
Array item

Schema: DeviceMapping

All schema constraints and annotations
{
  "description": "A list of devices to add to the container.",
  "items": {
    "$ref": "#/components/schemas/DeviceMapping"
  },
  "type": "array"
}
IOMaximumBandwidth

Type: integer

Maximum IO in bytes per second for the container system drive (Windows only).
All schema constraints and annotations
{
  "description": "Maximum IO in bytes per second for the container system drive\n(Windows only).\n",
  "format": "int64",
  "type": "integer"
}
IOMaximumIOps

Type: integer

Maximum IOps for the container system drive (Windows only)
All schema constraints and annotations
{
  "description": "Maximum IOps for the container system drive (Windows only)",
  "format": "int64",
  "type": "integer"
}
Init

Type: boolean

Run an init inside the container that forwards signals and reaps processes. This field is omitted if empty, and the default (as configured on the daemon) is used.
All schema constraints and annotations
{
  "description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n",
  "type": "boolean",
  "x-nullable": true
}
Memory

Type: integer

Memory limit in bytes.
All schema constraints and annotations
{
  "default": 0,
  "description": "Memory limit in bytes.",
  "format": "int64",
  "type": "integer"
}
MemoryReservation

Type: integer

Memory soft limit in bytes.
All schema constraints and annotations
{
  "description": "Memory soft limit in bytes.",
  "format": "int64",
  "type": "integer"
}
MemorySwap

Type: integer

Total memory limit (memory + swap). Set as -1 to enable unlimited swap.
All schema constraints and annotations
{
  "description": "Total memory limit (memory + swap). Set as `-1` to enable unlimited\nswap.\n",
  "format": "int64",
  "type": "integer"
}
MemorySwappiness

Type: integer

Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
All schema constraints and annotations
{
  "description": "Tune a container's memory swappiness behavior. Accepts an integer\nbetween 0 and 100.\n",
  "format": "int64",
  "maximum": 100,
  "minimum": 0,
  "type": "integer"
}
NanoCpus

Type: integer

CPU quota in units of 10-9 CPUs.
All schema constraints and annotations
{
  "description": "CPU quota in units of 10\u003csup\u003e-9\u003c/sup\u003e CPUs.",
  "format": "int64",
  "type": "integer"
}
OomKillDisable

Type: boolean

Disable OOM Killer for the container.
All schema constraints and annotations
{
  "description": "Disable OOM Killer for the container.",
  "type": "boolean"
}
PidsLimit

Type: integer

Tune a container's PIDs limit. Set 0 or -1 for unlimited, or null to not change.
All schema constraints and annotations
{
  "description": "Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null`\nto not change.\n",
  "format": "int64",
  "type": "integer",
  "x-nullable": true
}
Ulimits

Type: array

A list of resource limits to set in the container. For example:

{"Name": "nofile", "Soft": 1024, "Hard": 2048}
Array item

Type: object

Hard

Type: integer

Hard limit
All schema constraints and annotations
{
  "description": "Hard limit",
  "type": "integer"
}
Name

Type: string

Name of ulimit
All schema constraints and annotations
{
  "description": "Name of ulimit",
  "type": "string"
}
Soft

Type: integer

Soft limit
All schema constraints and annotations
{
  "description": "Soft limit",
  "type": "integer"
}
All schema constraints and annotations
{
  "properties": {
    "Hard": {
      "description": "Hard limit",
      "type": "integer"
    },
    "Name": {
      "description": "Name of ulimit",
      "type": "string"
    },
    "Soft": {
      "description": "Soft limit",
      "type": "integer"
    }
  },
  "type": "object"
}
All schema constraints and annotations
{
  "description": "A list of resource limits to set in the container. For example:\n\n```\n{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}\n```\n",
  "items": {
    "properties": {
      "Hard": {
        "description": "Hard limit",
        "type": "integer"
      },
      "Name": {
        "description": "Name of ulimit",
        "type": "string"
      },
      "Soft": {
        "description": "Soft limit",
        "type": "integer"
      }
    },
    "type": "object"
  },
  "type": "array"
}
All schema constraints and annotations
{
  "description": "A container's resources (cgroups config, ulimits, etc)",
  "properties": {
    "BlkioDeviceReadBps": {
      "description": "Limit read rate (bytes per second) from a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n",
      "items": {
        "$ref": "#/components/schemas/ThrottleDevice"
      },
      "type": "array"
    },
    "BlkioDeviceReadIOps": {
      "description": "Limit read rate (IO per second) from a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n",
      "items": {
        "$ref": "#/components/schemas/ThrottleDevice"
      },
      "type": "array"
    },
    "BlkioDeviceWriteBps": {
      "description": "Limit write rate (bytes per second) to a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n",
      "items": {
        "$ref": "#/components/schemas/ThrottleDevice"
      },
      "type": "array"
    },
    "BlkioDeviceWriteIOps": {
      "description": "Limit write rate (IO per second) to a device, in the form:\n\n```\n[{\"Path\": \"device_path\", \"Rate\": rate}]\n```\n",
      "items": {
        "$ref": "#/components/schemas/ThrottleDevice"
      },
      "type": "array"
    },
    "BlkioWeight": {
      "description": "Block IO weight (relative weight).",
      "maximum": 1000,
      "minimum": 0,
      "type": "integer"
    },
    "BlkioWeightDevice": {
      "description": "Block IO weight (relative device weight) in the form:\n\n```\n[{\"Path\": \"device_path\", \"Weight\": weight}]\n```\n",
      "items": {
        "properties": {
          "Path": {
            "type": "string"
          },
          "Weight": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "CgroupParent": {
      "description": "Path to `cgroups` under which the container's `cgroup` is created. If\nthe path is not absolute, the path is considered to be relative to the\n`cgroups` path of the init process. Cgroups are created if they do not\nalready exist.\n",
      "type": "string"
    },
    "CpuCount": {
      "description": "The number of usable CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are\nmutually exclusive. The order of precedence is `CPUCount` first, then\n`CPUShares`, and `CPUPercent` last.\n",
      "format": "int64",
      "type": "integer"
    },
    "CpuPercent": {
      "description": "The usable percentage of the available CPUs (Windows only).\n\nOn Windows Server containers, the processor resource controls are\nmutually exclusive. The order of precedence is `CPUCount` first, then\n`CPUShares`, and `CPUPercent` last.\n",
      "format": "int64",
      "type": "integer"
    },
    "CpuPeriod": {
      "description": "The length of a CPU period in microseconds.",
      "format": "int64",
      "type": "integer"
    },
    "CpuQuota": {
      "description": "Microseconds of CPU time that the container can get in a CPU period.\n",
      "format": "int64",
      "type": "integer"
    },
    "CpuRealtimePeriod": {
      "description": "The length of a CPU real-time period in microseconds. Set to 0 to\nallocate no time allocated to real-time tasks.\n",
      "format": "int64",
      "type": "integer"
    },
    "CpuRealtimeRuntime": {
      "description": "The length of a CPU real-time runtime in microseconds. Set to 0 to\nallocate no time allocated to real-time tasks.\n",
      "format": "int64",
      "type": "integer"
    },
    "CpuShares": {
      "description": "An integer value representing this container's relative CPU weight\nversus other containers.\n",
      "type": "integer"
    },
    "CpusetCpus": {
      "description": "CPUs in which to allow execution (e.g., `0-3`, `0,1`).\n",
      "example": "0-3",
      "type": "string"
    },
    "CpusetMems": {
      "description": "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only\neffective on NUMA systems.\n",
      "type": "string"
    },
    "DeviceCgroupRules": {
      "description": "a list of cgroup rules to apply to the container",
      "items": {
        "example": "c 13:* rwm",
        "type": "string"
      },
      "type": "array"
    },
    "DeviceRequests": {
      "description": "A list of requests for devices to be sent to device drivers.\n",
      "items": {
        "$ref": "#/components/schemas/DeviceRequest"
      },
      "type": "array"
    },
    "Devices": {
      "description": "A list of devices to add to the container.",
      "items": {
        "$ref": "#/components/schemas/DeviceMapping"
      },
      "type": "array"
    },
    "IOMaximumBandwidth": {
      "description": "Maximum IO in bytes per second for the container system drive\n(Windows only).\n",
      "format": "int64",
      "type": "integer"
    },
    "IOMaximumIOps": {
      "description": "Maximum IOps for the container system drive (Windows only)",
      "format": "int64",
      "type": "integer"
    },
    "Init": {
      "description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n",
      "type": "boolean",
      "x-nullable": true
    },
    "Memory": {
      "default": 0,
      "description": "Memory limit in bytes.",
      "format": "int64",
      "type": "integer"
    },
    "MemoryReservation": {
      "description": "Memory soft limit in bytes.",
      "format": "int64",
      "type": "integer"
    },
    "MemorySwap": {
      "description": "Total memory limit (memory + swap). Set as `-1` to enable unlimited\nswap.\n",
      "format": "int64",
      "type": "integer"
    },
    "MemorySwappiness": {
      "description": "Tune a container's memory swappiness behavior. Accepts an integer\nbetween 0 and 100.\n",
      "format": "int64",
      "maximum": 100,
      "minimum": 0,
      "type": "integer"
    },
    "NanoCpus": {
      "description": "CPU quota in units of 10\u003csup\u003e-9\u003c/sup\u003e CPUs.",
      "format": "int64",
      "type": "integer"
    },
    "OomKillDisable": {
      "description": "Disable OOM Killer for the container.",
      "type": "boolean"
    },
    "PidsLimit": {
      "description": "Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null`\nto not change.\n",
      "format": "int64",
      "type": "integer",
      "x-nullable": true
    },
    "Ulimits": {
      "description": "A list of resource limits to set in the container. For example:\n\n```\n{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}\n```\n",
      "items": {
        "properties": {
          "Hard": {
            "description": "Hard limit",
            "type": "integer"
          },
          "Name": {
            "description": "Name of ulimit",
            "type": "string"
          },
          "Soft": {
            "description": "Soft limit",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "array"
    }
  },
  "type": "object"
}