NAME
API::Docker::Type::Resources - A container's resources (cgroups config, ulimits, etc)
VERSION
version 0.004
DESCRIPTION
Generated from the Resources definition of spec/v1.51.yaml.
API::Docker::Type::HostConfig is allOf [ $ref Resources, ... ] in the swagger and therefore inherits from this class, which is why every field below is also a field of a HostConfig. TaskSpec references the definition directly.
cpu_shares
An integer value representing this container's relative CPU weight versus other containers.
memory
Memory limit in bytes. The daemon defaults it to 0.
cgroup_parent
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.
blkio_weight
Block IO weight (relative weight).
blkio_weight_device
Block IO weight (relative device weight) in the form:
[{"Path": "device_path", "Weight": weight}]
See API::Docker::Type::Resources::BlkioWeightDevice.
blkio_device_read_bps
Limit read rate (bytes per second) from a device, in the form:
[{"Path": "device_path", "Rate": rate}]
See API::Docker::Type::ThrottleDevice.
blkio_device_write_bps
Limit write rate (bytes per second) to a device, in the form:
[{"Path": "device_path", "Rate": rate}]
See API::Docker::Type::ThrottleDevice.
blkio_device_read_iops
Limit read rate (IO per second) from a device, in the form:
[{"Path": "device_path", "Rate": rate}]
See API::Docker::Type::ThrottleDevice. Serialised as BlkioDeviceReadIOps -- spelled out, because deriving it from the Perl name would produce BlkioDeviceReadIops.
blkio_device_write_iops
Limit write rate (IO per second) to a device, in the form:
[{"Path": "device_path", "Rate": rate}]
See API::Docker::Type::ThrottleDevice. Serialised as BlkioDeviceWriteIOps -- spelled out, because deriving it from the Perl name would produce BlkioDeviceWriteIops.
cpu_period
The length of a CPU period in microseconds.
cpu_quota
Microseconds of CPU time that the container can get in a CPU period.
cpu_realtime_period
The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks.
cpu_realtime_runtime
The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks.
cpuset_cpus
CPUs in which to allow execution (e.g., 0-3, 0,1).
cpuset_mems
Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
devices
A list of devices to add to the container. See API::Docker::Type::DeviceMapping.
device_cgroup_rules
A list of cgroup rules to apply to the container.
device_requests
A list of requests for devices to be sent to device drivers. See API::Docker::Type::DeviceRequest.
kernel_memory_tcp
Hard limit for kernel TCP buffer memory (in bytes). Depending on the OCI runtime in use, this option may be ignored. It is no longer supported by the default (runc) runtime.
This field is omitted when empty.
Deprecated: This field is deprecated as kernel 6.12 has deprecated memory.kmem.tcp.limit_in_bytes field for cgroups v1. This field will be removed in a future release. Serialised as KernelMemoryTCP -- spelled out, because deriving it from the Perl name would produce KernelMemoryTcp.
memory_reservation
Memory soft limit in bytes.
memory_swap
Total memory limit (memory + swap). Set as -1 to enable unlimited swap.
memory_swappiness
Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
nano_cpus
CPU quota in units of 10^-9 CPUs.
oom_kill_disable
Disable OOM Killer for the container.
init
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.
pids_limit
Tune a container's PIDs limit. Set 0 or -1 for unlimited, or null to not change.
ulimits
A list of resource limits to set in the container. For example:
{"Name": "nofile", "Soft": 1024, "Hard": 2048}
See API::Docker::Type::Resources::Ulimit.
cpu_count
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.
cpu_percent
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.
io_maximum_iops
Maximum IOps for the container system drive (Windows only). Serialised as IOMaximumIOps -- spelled out, because deriving it from the Perl name would produce IoMaximumIops.
io_maximum_bandwidth
Maximum IO in bytes per second for the container system drive (Windows only). Serialised as IOMaximumBandwidth -- spelled out, because deriving it from the Perl name would produce IoMaximumBandwidth.
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-api-docker/issues.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <getty@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.