Skip to content

docs: add deprecation notice for --kernel-memory flag#6922

Open
mohithshuka wants to merge 1 commit intodocker:masterfrom
mohithshuka:fix/kernel-memory-deprecation-notice
Open

docs: add deprecation notice for --kernel-memory flag#6922
mohithshuka wants to merge 1 commit intodocker:masterfrom
mohithshuka:fix/kernel-memory-deprecation-notice

Conversation

@mohithshuka
Copy link
Copy Markdown

Fixes #24643

The --kernel-memory flag was deprecated in Docker v20.10 and removed
in Docker v23.0, but the run reference page had no deprecation notice.

Changes

  • Added **Deprecated** notice to the --kernel-memory row in the
    options table
  • Added a deprecation callout block at the top of the
    ### Kernel memory constraints section explaining:
    • Deprecated in v20.10, removed in v23.0
    • Linux kernel deprecated kmem.limit_in_bytes in v5.4
    • OCI runtimes such as runc no longer support this option
    • Docker API v1.42+ ignores this option when set
    • Links to the official Deprecated features page

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.
@mohithshuka mohithshuka requested a review from thaJeztah as a code owner April 9, 2026 17:52
Copilot AI review requested due to automatic review settings April 9, 2026 17:52
@mohithshuka mohithshuka requested a review from a team as a code owner April 9, 2026 17:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds explicit documentation deprecation messaging for the docker run --kernel-memory flag, aligning the run reference page with the feature’s deprecation/removal timeline.

Changes:

  • Marked --kernel-memory as Deprecated in the runtime constraints options table.
  • Added a deprecation callout to the “Kernel memory constraints” section describing deprecation/removal and linking to the deprecated features page.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

| `--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. |
Copy link

Copilot AI Apr 9, 2026

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+).

Copilot uses AI. Check for mistakes.
Comment on lines +505 to +506
> **Deprecated**
>
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This deprecation notice uses a custom blockquote header (> **Deprecated**), but this doc (and others in the repo) generally use the standard admonition syntax (> [!NOTE], > [!IMPORTANT], > [!WARNING]) for callouts. Using the standard admonition form here would keep rendering and styling consistent across the docs site.

Copilot uses AI. Check for mistakes.
Comment on lines +507 to +512
> 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.
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The callout says --kernel-memory was removed in Docker v23.0 / ignored by API v1.42+, but the section immediately below still presents --kernel-memory usage and examples as current guidance. To avoid confusing readers, consider explicitly labeling the remainder of this section/examples as legacy (Engine <= 20.10) or removing/updating the examples to reflect that the flag is deprecated/ignored.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants