Skip to content

Commit 0015f6c

Browse files
committed
docs: add deprecation notice for --kernel-memory flag
Fixes #24643 --kernel-memory was deprecated in v20.10 and removed in v23.0. Add deprecation callouts to both the options table and the Kernel memory constraints section of the run reference page.
1 parent 950401c commit 0015f6c

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

docs/reference/run.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ container:
334334
| `-m`, `--memory=""` | Memory limit (format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. Minimum is 6M. |
335335
| `--memory-swap=""` | Total memory limit (memory + swap, format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. |
336336
| `--memory-reservation=""` | Memory soft limit (format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. |
337-
| `--kernel-memory=""` | Kernel memory limit (format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. Minimum is 4M. |
337+
| `--kernel-memory=""` | **Deprecated**: Kernel memory limit. Deprecated in Docker v20.10, and removed in Docker v23.0. This option is ignored when set. |
338338
| `-c`, `--cpu-shares=0` | CPU shares (relative weight) |
339339
| `--cpus=0.000` | Number of CPUs. Number is a fractional number. 0.000 means no limit. |
340340
| `--cpu-period=0` | Limit the CPU CFS (Completely Fair Scheduler) period |
@@ -502,6 +502,15 @@ less likely to be killed, and positive scores more likely.
502502

503503
### Kernel memory constraints
504504

505+
> **Deprecated**
506+
>
507+
> The `--kernel-memory` option was deprecated in Docker v20.10 and removed in
508+
> Docker v23.0. The Linux kernel deprecated `kmem.limit_in_bytes` in kernel
509+
> v5.4, and OCI runtimes such as runc no longer support this option. Docker API
510+
> v1.42 and later ignores this option when set. Do not use `--kernel-memory` in
511+
> new configurations. For more details, see the
512+
> [Deprecated features](https://docs.docker.com/engine/deprecated/) page.
513+
505514
Kernel memory is fundamentally different than user memory as kernel memory can't
506515
be swapped out. The inability to swap makes it possible for the container to
507516
block system services by consuming too much kernel memory. Kernel memory includes:

0 commit comments

Comments
 (0)