-
Notifications
You must be signed in to change notification settings - Fork 2.1k
docs: add deprecation notice for --kernel-memory flag #6922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -334,7 +334,7 @@ container: | |
| | `-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. | | ||
| | `--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`. | | ||
| | `--memory-reservation=""` | Memory soft limit (format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. | | ||
| | `--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. | | ||
| | `--kernel-memory=""` | **Deprecated**: Kernel memory limit. Deprecated in Docker v20.10, and removed in Docker v23.0. This option is ignored when set. | | ||
| | `-c`, `--cpu-shares=0` | CPU shares (relative weight) | | ||
| | `--cpus=0.000` | Number of CPUs. Number is a fractional number. 0.000 means no limit. | | ||
| | `--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. | |
|
|
||
| ### Kernel memory constraints | ||
|
|
||
| > **Deprecated** | ||
| > | ||
|
Comment on lines
+505
to
+506
|
||
| > The `--kernel-memory` option was deprecated in Docker v20.10 and removed in | ||
| > Docker v23.0. The Linux kernel deprecated `kmem.limit_in_bytes` in kernel | ||
| > v5.4, and OCI runtimes such as runc no longer support this option. Docker API | ||
| > v1.42 and later ignores this option when set. Do not use `--kernel-memory` in | ||
| > new configurations. For more details, see the | ||
| > [Deprecated features](https://docs.docker.com/engine/deprecated/) page. | ||
|
Comment on lines
+507
to
+512
|
||
|
|
||
| Kernel memory is fundamentally different than user memory as kernel memory can't | ||
| be swapped out. The inability to swap makes it possible for the container to | ||
| block system services by consuming too much kernel memory. Kernel memory includes: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the options table, the new wording drops the original value format/unit details and states unconditionally that the option is ignored when set. That’s potentially misleading: older Engine versions may still honor the limit, while newer Engines ignore it (and newer CLIs may remove the flag entirely). Consider keeping the original format guidance and scoping the “ignored” behavior to the specific Engine/API versions where it applies (e.g., Engine v23.0+/API v1.42+).