1
0
mirror of https://github.com/docker/cli.git synced 2026-01-26 15:41:42 +03:00
Commit Graph

12190 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
7abc65bc06 cli/command: remove deprecated ResolveDefaultContext
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-11 00:40:22 +02:00
Sebastiaan van Stijn
c2817e2d59 Dockerfile: bump github.com/josephspurrier/goversioninfo to v1.5.0
- Upgrade to Go 1.18 minimum version and remove ioutil references
- Move from Travis to GitHub Actions for CI
- Support multiple icons
- Add options to parse version string

full diff: https://github.com/josephspurrier/goversioninfo/compare/v1.4.1...v1.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-11 00:11:08 +02:00
Sebastiaan van Stijn
f68d8f1f24 scripts/build/mkversioninfo: use permalink in comment
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-11 00:03:50 +02:00
Sebastiaan van Stijn
830e1d60ab Dockerfile: update compose to v2.40.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-10 23:59:38 +02:00
Sebastiaan van Stijn
9def7748a5 Dockerfile: update buildx to v0.29.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-10 23:58:35 +02:00
Sebastiaan van Stijn
f8b1b8d165 Dockerfile: bump gotest.tools/gotestsum v1.13.0
full diff: https://github.com/gotestyourself/gotestsum/compare/v1.12.3...v1.13.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-10 23:55:52 +02:00
Sebastiaan van Stijn
01febbc3bb Merge pull request #6551 from thaJeztah/remove_legacy_api_versions
remove API-version compatibility for API < v1.44
2025-10-10 22:53:01 +02:00
Sebastiaan van Stijn
59d228cd98 Merge pull request #6550 from thaJeztah/deprecate_builder_utils
cli/command/image/build: deprecate IsArchive utility
2025-10-10 22:46:27 +02:00
Sebastiaan van Stijn
5ad91456c7 docs: update some versions in examples
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-10 21:23:30 +02:00
Sebastiaan van Stijn
4c73cefc15 cli/command/container, image: remove addPlatformFlag utility
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-10 21:23:30 +02:00
Sebastiaan van Stijn
b8f2b7c678 cli/command/service: remove AppendServiceStatus (API <v1.41)
This function was added in 7405ac5c2d as
a fallback for API < v1.41, which did not include the service status
in the response. Current API versions return this information, so there's
no need to fetch it manually.

It was not gated by API version for some tests (which didn't set API
version), but should not be needed for non-test situations.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-10 21:23:29 +02:00
Sebastiaan van Stijn
f046bd371a cli/command/container: rm use of deprecated MacAddress field
This field is no longer in use since API v1.44.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-10 21:23:29 +02:00
Sebastiaan van Stijn
d36f16e224 remove API-version compatibility for API < v1.44
Support for API versions < v1.44 was removed in the client in [moby@96b29f5]
and [moby@7652f38], so we can remove fallback-code from the CLI as well,
as it won't be able to use those versions.

[moby@96b29f5]: 96b29f5a1f
[moby@7652f38]: 7652f38c28

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-10 21:23:25 +02:00
Sebastiaan van Stijn
a3e954551d Merge pull request #6545 from thaJeztah/bump_engine_take2
vendor: github.com/moby/moby/api, client 0769fe708773 (master)
2025-10-10 19:45:23 +02:00
Sebastiaan van Stijn
f81816ef88 vendor: github.com/moby/moby/api, client 0769fe708773 (master)
full diff: 4ca8aedf92...0769fe7087

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-10 19:35:00 +02:00
Sebastiaan van Stijn
9e646f6d92 cli/command/image: runBuild: inline vars and minor cleanups
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-10 17:25:04 +02:00
Sebastiaan van Stijn
64be664e85 cli/command/image/build: deprecate IsArchive utility
It was only used internally.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-10 17:23:57 +02:00
Sebastiaan van Stijn
2c539a6530 cli/command/image/build: fix linting, add sub-tests
- fix minor linting issues (unhandled errors)
- rename vars to prevent shadowing
- use sub-tests for tests that already prepared for it

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-10 17:21:57 +02:00
Austin Vazquez
6ddff81bee Merge pull request #6548 from thaJeztah/improve_TestRemove
e2e/stack: don't run stack deploy "detached"
2025-10-09 14:57:55 -05:00
Sebastiaan van Stijn
85ac71a3fe e2e/stack: don't run stack deploy "detached"
Run stack deploy in "attached" mode, so that progress and errors
can be printed on failure.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-09 17:19:41 +02:00
Austin Vazquez
41432adc36 Merge pull request #6547 from thaJeztah/deprecate_ValidateMACAddress
opts: deprecate ValidateMACAddress
2025-10-09 09:13:34 -05:00
Sebastiaan van Stijn
17d6a92954 opts: deprecate ValidateMACAddress
It was a wrapper around net.ParseMAC from stdlib, so users should
use that directly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-09 13:46:33 +02:00
Sebastiaan van Stijn
94788a3b63 Merge pull request #6546 from thaJeztah/test_improvements
assorted test-improvements
2025-10-09 12:46:00 +02:00
Sebastiaan van Stijn
af34b8471a cli/command/network: TestNetworkCreateWithFlags: fix unhandled errs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-09 12:29:56 +02:00
Sebastiaan van Stijn
c8014ec509 cli/command/network: TestNetworkCreateErrors: use sub-tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-09 12:22:08 +02:00
Sebastiaan van Stijn
413ee120de cli/command/container: TestParseWithExpose: use sub-tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-09 12:13:25 +02:00
Sebastiaan van Stijn
7923f440ed cli/command/container: update todo comment
Provide some context to the TODO

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-09 11:51:07 +02:00
Sebastiaan van Stijn
b1ea4fe9d9 Merge pull request #6543 from docker/dependabot/github_actions/github/codeql-action-4
build(deps): bump github/codeql-action from 3 to 4
2025-10-08 16:22:13 +02:00
dependabot[bot]
5483b10e94 build(deps): bump github/codeql-action from 3 to 4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-08 08:04:23 +00:00
Austin Vazquez
9f941a49c1 Merge pull request #6540 from vvoland/update-go
update to go1.24.8
2025-10-07 19:47:18 -07:00
Paweł Gronowski
e598ea0176 update to go1.24.8
This minor release includes 10 security fixes following the security policy:

- net/mail: excessive CPU consumption in ParseAddress

    The ParseAddress function constructed domain-literal address components through repeated string concatenation. When parsing large domain-literal components, this could cause excessive CPU consumption.

    Thanks to Philippe Antoine (Catena cyber) for reporting this issue.

    This is CVE-2025-61725 and Go issue https://go.dev/issue/75680.

- crypto/x509: quadratic complexity when checking name constraints

    Due to the design of the name constraint checking algorithm, the processing time
    of some inputs scales non-linearly with respect to the size of the certificate.

    This affects programs which validate arbitrary certificate chains.

    Thanks to Jakub Ciolek for reporting this issue.

    This is CVE-2025-58187 and Go issue https://go.dev/issue/75681.

- crypto/tls: ALPN negotiation errors can contain arbitrary text

    The crypto/tls conn.Handshake method returns an error on the server-side when
    ALPN negotation fails which can contain arbitrary attacker controlled
    information provided by the client-side of the connection which is not escaped.

    This affects programs which log these errors without any additional form of
    sanitization, and may allow injection of attacker controlled information into
    logs.

    Thanks to National Cyber Security Centre Finland for reporting this issue.

    This is CVE-2025-58189 and Go issue https://go.dev/issue/75652.

- encoding/pem: quadratic complexity when parsing some invalid inputs

    Due to the design of the PEM parsing function, the processing time for some
    inputs scales non-linearly with respect to the size of the input.

    This affects programs which parse untrusted PEM inputs.

    Thanks to Jakub Ciolek for reporting this issue.

    This is CVE-2025-61723 and Go issue https://go.dev/issue/75676.

- net/url: insufficient validation of bracketed IPv6 hostnames

    The Parse function permitted values other than IPv6 addresses to be included in square brackets within the host component of a URL. RFC 3986 permits IPv6 addresses to be included within the host component, enclosed within square brackets. For example: "http://[::1]/". IPv4 addresses and hostnames must not appear within square brackets. Parse did not enforce this requirement.

    Thanks to Enze Wang, Jingcheng Yang and Zehui Miao of Tsinghua University for reporting this issue.

    This is CVE-2025-47912 and Go issue https://go.dev/issue/75678.

- encoding/asn1: pre-allocating memory when parsing DER payload can cause memory exhaustion

    When parsing DER payloads, memories were being allocated prior to fully validating the payloads.
    This permits an attacker to craft a big empty DER payload to cause memory exhaustion in functions such as asn1.Unmarshal, x509.ParseCertificateRequest, and ocsp.ParseResponse.

    Thanks to Jakub Ciolek for reporting this issue.

    This is CVE-2025-58185 and Go issue https://go.dev/issue/75671.

- net/http: lack of limit when parsing cookies can cause memory exhaustion

    Despite HTTP headers having a default limit of 1 MB, the number of cookies that can be parsed did not have a limit.
    By sending a lot of very small cookies such as "a=;", an attacker can make an HTTP server allocate a large amount of structs, causing large memory consumption.

    net/http now limits the number of cookies accepted to 3000, which can be adjusted using the httpcookiemaxnum GODEBUG option.

    Thanks to jub0bs for reporting this issue.

    This is CVE-2025-58186 and Go issue https://go.dev/issue/75672.

- crypto/x509: panic when validating certificates with DSA public keys

    Validating certificate chains which contain DSA public keys can cause programs
    to panic, due to a interface cast that assumes they implement the Equal method.

    This affects programs which validate arbitrary certificate chains.

    Thanks to Jakub Ciolek for reporting this issue.

    This is CVE-2025-58188 and Go issue https://go.dev/issue/75675.

- archive/tar: unbounded allocation when parsing GNU sparse map

    tar.Reader did not set a maximum size on the number of sparse region data blocks in GNU tar pax 1.0 sparse files. A maliciously-crafted archive containing a large number of sparse regions could cause a Reader to read an unbounded amount of data from the archive into memory. When reading from a compressed source, a small compressed input could result in large allocations.

    Thanks to Harshit Gupta (Mr HAX) - https://www.linkedin.com/in/iam-harshit-gupta/ for reporting this issue.

    This is CVE-2025-58183 and Go issue https://go.dev/issue/75677.

- net/textproto: excessive CPU consumption in Reader.ReadResponse

    The Reader.ReadResponse function constructed a response string through
    repeated string concatenation of lines. When the number of lines in a response is large,
    this could cause excessive CPU consumption.

    Thanks to Jakub Ciolek for reporting this issue.

    This is CVE-2025-61724 and Go issue https://go.dev/issue/75716.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-07 21:46:51 +02:00
Austin Vazquez
d17643a675 Merge pull request #6537 from thaJeztah/no_nw_shadow
rename some vars to prevent shadowing imports
2025-10-07 06:31:30 -07:00
Sebastiaan van Stijn
3754fe3c8a rename some vars to prevent shadowing imports
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-06 22:49:02 +02:00
Austin Vazquez
30ec4c09b3 Merge pull request #6536 from thaJeztah/cleanups
cli/command/container: inline some variables
2025-10-06 13:21:31 -07:00
Austin Vazquez
6d351158cc Merge pull request #6535 from thaJeztah/remove_localhostDNSWarning
cli/command/container: remove localhostDNSWarning
2025-10-06 13:10:37 -07:00
Sebastiaan van Stijn
6222292566 cli/command/container: inline some variables
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-06 21:26:17 +02:00
Sebastiaan van Stijn
c06c08531a cli/command/container: remove localhostDNSWarning
This warning is better handled by the daemon, where applicable, as
the client does not have all information available to determine
if using a localhost / loopback-address for the DNS is possible.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-06 21:23:50 +02:00
Paweł Gronowski
74e3520724 Merge pull request #6530 from thaJeztah/bump_macos
gha: add macOS 15, remove macOS 13 (deprecated)
2025-10-03 14:04:10 +00:00
Paweł Gronowski
886e041790 Merge pull request #6532 from thaJeztah/bump_creds_helper_0.9.4
vendor: github.com/docker/docker-credential-helpers v0.9.4
2025-10-03 14:02:59 +00:00
Paweł Gronowski
9dea52c193 Merge pull request #6527 from thaJeztah/no_WithInitializeClient
cli/command: don't use WithInitializeClient in test
2025-10-03 14:02:37 +00:00
Paweł Gronowski
780c427550 Merge pull request #6526 from thaJeztah/no_plugin_load
cmd/docker: setFlagErrorFunc: don't load plugins for invalid flags
2025-10-03 14:02:16 +00:00
Sebastiaan van Stijn
ca6f899a58 Merge pull request #6525 from thaJeztah/rm_client_side_autorm
remove support for AutoRemove (`--rm`) on API < 1.30
2025-10-03 11:58:03 +02:00
Sebastiaan van Stijn
395152ce88 vendor: github.com/docker/docker-credential-helpers v0.9.4
full diff: https://github.com/docker/docker-credential-helpers/compare/v0.9.3...v0.9.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-02 22:25:45 +02:00
Paweł Gronowski
f5a7a3c72e Merge pull request #6528 from thaJeztah/deprecate_ResolveDefaultContext
cli/command: deprecate ResolveDefaultContext
2025-10-01 13:25:04 +00:00
Sebastiaan van Stijn
394ab41696 Merge pull request #6524 from thaJeztah/rm_deprecated_virtualsize
remove VirtualSize formatting options and output
2025-10-01 12:09:25 +02:00
Sebastiaan van Stijn
91d8c0bf62 gha: add macOS 15, remove macOS 13 (deprecated)
The macOS 13 runners are deprecated and will be removed on December 4th,
with brownouts in November;
https://github.blog/changelog/2025-09-19-github-actions-macos-13-runner-image-is-closing-down/

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-01 11:59:56 +02:00
Sebastiaan van Stijn
311a97a210 cli/command: deprecate ResolveDefaultContext
The ResolveDefaultContext function was exported in [cli@f820766] to allow
(unit) testing, but did not document that it was only exported for this
purpose. The only external use of this function is in buildx, which uses
it in a unit test that can be implemented without this function.

This patch deprecates the function so that we can remove it.

[cli@f820766]: f820766f6a

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-01 11:47:24 +02:00
Sebastiaan van Stijn
b375006c3e cli/command: don't use WithInitializeClient in test
It's just a wrapper around WithAPIClient, and not needed for this
test, which validates that "Initialize" properly creates the context
store, even if a client was already set;
3b26cfce8b

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-01 10:12:11 +02:00
Sebastiaan van Stijn
b0201c8531 cmd/docker: hideUnsupportedFeatures: remove unused error return
```
70.72 cmd/docker/docker.go:560:74: hideUnsupportedFeatures - result 0 (error) is always nil (unparam)
70.72 func hideUnsupportedFeatures(cmd *cobra.Command, details versionDetails) error {
70.72                                                                          ^
70.72 1 issues:
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-01 01:57:59 +02:00
Sebastiaan van Stijn
2b4fd0d750 cmd/docker: setFlagErrorFunc: don't load plugins for invalid flags
On Docker CLI versions before v28.0.0, using an unknown flag would print
the usage output, showing all available top-level flags and commands;

    docker --badopt
    unknown flag: --badopt
    See 'docker --help'.

    Usage:  docker [OPTIONS] COMMAND

    A self-sufficient runtime for containers

    Options:
          --config string      Location of client config files (default "/root/.docker")
    ...

This output did not include plugin-commands, making the usage output
incomplete. That issue was fixed in [cli@40a6cf7], which loaded all
available cli-plugins, so that a stub was created for printing the
plugin commands in the usage output. Similarly, [cli@79a75da] added
code to hide experimental commands and commands not supported by the
daemon.

However, since 28.0.0 (commit [cli@f28fc7f]), the usage output was
removed for this error, so loading plugins is no longer needed;

    docker --badopt
    unknown flag: --badopt

    Usage:  docker [OPTIONS] COMMAND [ARG...]

    Run 'docker --help' for more information

This patch removes the code added in [cli@40a6cf7] and [cli@79a75da].

With this patch, the output is still the same;

    docker --unknown-flag buildx ls --no-such
    unknown flag: --unknown-flag

    Usage:  docker [OPTIONS] COMMAND [ARG...]

    Run 'docker --help' for more information

This function only handles flags defined by the CLI itself; invalid
flags for plugins are handled by the plugin itself, so are not
impacted;

    docker buildx ls --no-such
    unknown flag: --no-such

    Usage:  docker buildx ls

    Run 'docker buildx ls --help' for more information

[cli@f28fc7f]: f28fc7f82f
[cli@40a6cf7]: 40a6cf7c47
[cli@79a75da]: 79a75da0fd

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-01 01:15:53 +02:00