-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(cp): clarify --archive flag description #6937
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
0015f6c
cbeeefe
397a379
044dea2
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -364,6 +364,24 @@ func DisplayablePorts(ports []container.PortSummary) string { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var result []string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var hostMappings []string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var groupMapKeys []string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Pre-pass: record which (hostPort, privatePort, proto) tuples have an | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // IPv4 wildcard (0.0.0.0) binding. Used below to suppress the matching | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // IPv6 wildcard (::) entry, avoiding duplicate output such as: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // 0.0.0.0:8080->80/tcp, :::8080->80/tcp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // See: https://github.com/docker/cli/issues/6869 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+368
to
+372
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type mappingKey struct { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hostPort uint16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| privatePort uint16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| proto string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ipv4Bindings := make(map[mappingKey]bool) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for _, port := range ports { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if port.IP.String() == "0.0.0.0" && port.PublicPort != 0 { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ipv4Bindings[mappingKey{port.PublicPort, port.PrivatePort, port.Type}] = true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sort.Slice(ports, func(i, j int) bool { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return comparePorts(ports[i], ports[j]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -373,6 +391,18 @@ func DisplayablePorts(ports []container.PortSummary) string { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| portKey := port.Type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if port.IP.IsValid() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if port.PublicPort != current { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Suppress the IPv6 wildcard entry when an IPv4 wildcard | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // entry already covers the same (hostPort, privatePort, proto) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // tuple. This merges: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // 0.0.0.0:8080->80/tcp, :::8080->80/tcp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // into the cleaner: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // 0.0.0.0:8080->80/tcp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if port.IP.Is6() && !port.IP.Is4In6() && port.IP.IsUnspecified() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key := mappingKey{port.PublicPort, port.PrivatePort, port.Type} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ipv4Bindings[key] { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
393
to
+405
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if port.PublicPort != current { | |
| // Suppress the IPv6 wildcard entry when an IPv4 wildcard | |
| // entry already covers the same (hostPort, privatePort, proto) | |
| // tuple. This merges: | |
| // 0.0.0.0:8080->80/tcp, :::8080->80/tcp | |
| // into the cleaner: | |
| // 0.0.0.0:8080->80/tcp | |
| if port.IP.Is6() && !port.IP.Is4In6() && port.IP.IsUnspecified() { | |
| key := mappingKey{port.PublicPort, port.PrivatePort, port.Type} | |
| if ipv4Bindings[key] { | |
| continue | |
| } | |
| } | |
| // Suppress the IPv6 wildcard entry when an IPv4 wildcard | |
| // entry already covers the same (hostPort, privatePort, proto) | |
| // tuple. This merges: | |
| // 0.0.0.0:8080->80/tcp, :::8080->80/tcp | |
| // into the cleaner: | |
| // 0.0.0.0:8080->80/tcp | |
| // | |
| // Apply this before both formatting branches so grouped entries | |
| // for equal host/container ports (for example -p 80:80) also | |
| // suppress the redundant IPv6 wildcard binding. | |
| if port.IP.Is6() && !port.IP.Is4In6() && port.IP.IsUnspecified() { | |
| key := mappingKey{port.PublicPort, port.PrivatePort, port.Type} | |
| if ipv4Bindings[key] { | |
| continue | |
| } | |
| } | |
| if port.PublicPort != current { |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,7 +57,7 @@ func newPruneCommand(dockerCLI command.Cli) *cobra.Command { | |
| flags.BoolVarP(&options.all, "all", "a", false, "Remove all unused volumes, not just anonymous ones") | ||
| flags.SetAnnotation("all", "version", []string{"1.42"}) | ||
| flags.BoolVarP(&options.force, "force", "f", false, "Do not prompt for confirmation") | ||
| flags.Var(&options.filter, "filter", `Provide filter values (e.g. "label=<label>")`) | ||
| flags.Var(&options.filter, "filter", `Provide filter values (e.g. "label=<label>" or "label!=<label>")`) | ||
|
||
|
|
||
| return cmd | ||
| } | ||
|
|
||
| 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. | | ||||||
|
||||||
| | `--kernel-memory=""` | **Deprecated**: Kernel memory limit. Deprecated in Docker v20.10, and removed in Docker v23.0. This option is ignored when set. | | |
| | `--kernel-memory=""` | **Deprecated**: Kernel memory limit. Deprecated in Docker v20.10, no longer supported by the Engine since Docker v23.0, and ignored when set. | |
Copilot
AI
Apr 17, 2026
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.
After adding the deprecation notice, the rest of this section still describes --kernel-memory constraints and includes usage examples as if the limit is functional. Given the Engine ignores this option, consider either removing/updating the subsequent explanation/examples or clearly marking them as historical/unsupported to avoid misleading readers.
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.
The CLI help-string for
--archivewas updated, but the generated command reference docs (docs/reference/commandline/cp.mdanddocs/reference/commandline/container_cp.md) still contain the old description. If those docs are expected to match the CLI help output, they should be regenerated/updated as part of this change so the documentation fix is complete.