Compare commits

...
270 Commits
Author SHA1 Message Date
Sebastiaan van Stijn a82e528901 Merge pull request #7418 from vvoland/7417-29.x
[29.x] Update to go1.26.10
2026-10-20 13:24:07 +02:00
Paweł Gronowski e35bc1b6ae Update to go1.26.10
These releases include 1 security fix following the security policy:

- crypto/x509: mitigation for security concerns with a specific Certificate Authority

  We're blocking trust in a small set of intermediate certificates due to specific security concerns around their operation.

  Verify will now filter out chains which contain these intermediates, preventing them from being returned to the caller.

  We highly recommend immediately upgrading to this release.

  This is CVE-2026-111943 and Go issue https://go.dev/issue/82345.

release notes: https://go.dev/doc/devel/release#go1.26.10

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-10-20 12:42:59 +02:00
Paweł Gronowski baf6c13889 Bump version
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-10-20 12:40:09 +02:00
Paweł Gronowski 4051f75f69 Merge tag 'v29.9.1' into 7417-29.x
v29.9.1

# -----BEGIN PGP SIGNATURE-----
#
# iK0EABYKAFUWIQQX90wwlHYgZQhz61ZuYvmhLGnMZgUCas/KIxsUgAAAAAAEAA5t
# YW51MiwyLjUrMS4xMiwwLDMbHHBhd2VsLmdyb25vd3NraUBkb2NrZXIuY29tAAoJ
# EG5i+aEsacxmKWgBAKZGzyE7LzPW1Xy2ETngj+i8n96ZxkRPuzU7b2Rd+XLlAQCc
# YddGBSzdhrlh6EQtYdYMx7ArXfx7g8T10tGORAKqBw==
# =7Syv
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed Oct 14 20:29:55 2026 CEST
# gpg:                using EDDSA key 17F74C30947620650873EB566E62F9A12C69CC66
# gpg:                issuer "pawel.gronowski@docker.com"
# gpg: Good signature from "Paweł Gronowski <pawel.gronowski@docker.com>" [ultimate]
2026-10-20 12:39:56 +02:00
Paweł Gronowski 76321a699d Merge tag 'v29.9.0' into 7417-29.x
v29.9.0

# -----BEGIN PGP SIGNATURE-----
#
# iK0EABYKAFUWIQQX90wwlHYgZQhz61ZuYvmhLGnMZgUCasf+dhsUgAAAAAAEAA5t
# YW51MiwyLjUrMS4xMiwwLDMbHHBhd2VsLmdyb25vd3NraUBkb2NrZXIuY29tAAoJ
# EG5i+aEsacxm3EYBAKRhamCCxqMBniTJ9GtLRVn7G3gbweSztHdAzhCo70C6AP41
# K+a4eqECp+bjqTK1ldegnmdyAPZ8g8AoPMpJgSQ2CA==
# =N5Qp
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu Oct  8 22:35:02 2026 CEST
# gpg:                using EDDSA key 17F74C30947620650873EB566E62F9A12C69CC66
# gpg:                issuer "pawel.gronowski@docker.com"
# gpg: Good signature from "Paweł Gronowski <pawel.gronowski@docker.com>" [ultimate]
2026-10-20 12:39:56 +02:00
Paweł Gronowski b82456c62f Merge tag 'v29.8.2' into 7417-29.x
v29.8.2

# -----BEGIN PGP SIGNATURE-----
#
# iK0EABYKAFUWIQQX90wwlHYgZQhz61ZuYvmhLGnMZgUCar1jPxsUgAAAAAAEAA5t
# YW51MiwyLjUrMS4xMiwwLDMbHHBhd2VsLmdyb25vd3NraUBkb2NrZXIuY29tAAoJ
# EG5i+aEsacxmaQABAKG/rnQXNds4jV6qfRvaOS+tGa3Gy2hTY6o2aOgX3g3LAP4n
# OF3/gfVEcaQAK2dgxYTQnQvZi+/p69M1Bjsmy8ytBg==
# =x2Qn
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed Sep 30 21:30:07 2026 CEST
# gpg:                using EDDSA key 17F74C30947620650873EB566E62F9A12C69CC66
# gpg:                issuer "pawel.gronowski@docker.com"
# gpg: Good signature from "Paweł Gronowski <pawel.gronowski@docker.com>" [ultimate]
2026-10-20 12:39:55 +02:00
Paweł Gronowski a98becc3e3 Bump version
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-10-20 12:36:49 +02:00
Paweł Gronowski dfc520dcc2 Merge pull request #7390 from renovate-bot/renovate/go-1.x
chore(deps): update dependency go to v1.27.1
2026-10-14 20:09:52 +02:00
Mend Renovate a3a2bb6118 chore(deps): update dependency go to v1.27.1
Signed-off-by: Mend Renovate <bot@renovateapp.com>
2026-10-14 18:03:30 +00:00
Sebastiaan van Stijn c11295afc4 Merge pull request #7388 from renovate-bot/renovate/tonistiigi-xx-1.x
chore(deps): update tonistiigi/xx docker tag to v1.10.0
2026-10-14 18:11:18 +02:00
Sebastiaan van Stijn 010e125d8b Merge pull request #7386 from renovate-bot/renovate/docker-buildx-bin-0.x
chore(deps): update docker/buildx-bin docker tag to v0.38.0
2026-10-14 18:10:45 +02:00
Sebastiaan van Stijn 5cdf229230 Merge pull request #7387 from renovate-bot/renovate/docker-compose-bin-5.x
chore(deps): update docker/compose-bin docker tag to v5.6.0
2026-10-14 18:10:28 +02:00
Mend Renovate 66f6797582 chore(deps): update tonistiigi/xx docker tag to v1.10.0
Signed-off-by: Mend Renovate <bot@renovateapp.com>
2026-10-14 16:02:38 +00:00
Mend Renovate cb8870a537 chore(deps): update docker/compose-bin docker tag to v5.6.0
Signed-off-by: Mend Renovate <bot@renovateapp.com>
2026-10-14 16:02:33 +00:00
Mend Renovate 529f66d2f9 chore(deps): update docker/buildx-bin docker tag to v0.38.0
Signed-off-by: Mend Renovate <bot@renovateapp.com>
2026-10-14 16:02:28 +00:00
Paweł Gronowski 4d6ff7d646 Merge pull request #7380 from renovate-bot/renovate/actions-upload-artifact-7.x
chore(deps): update actions/upload-artifact action to v7.0.2
2026-10-14 16:53:33 +02:00
Paweł Gronowski b997c5b7aa Merge pull request #7381 from renovate-bot/renovate/docker-actions
chore(deps): update docker/setup-buildx-action action to v4.4.1
2026-10-14 16:49:47 +02:00
Mend Renovate 1822903c1d chore(deps): update docker/setup-buildx-action action to v4.4.1
Signed-off-by: Mend Renovate <bot@renovateapp.com>
2026-10-14 14:34:17 +00:00
Mend Renovate 37013cb262 chore(deps): update actions/upload-artifact action to v7.0.2
Signed-off-by: Mend Renovate <bot@renovateapp.com>
2026-10-14 14:34:11 +00:00
Paweł Gronowski 61ee187552 Merge pull request #7251 from vvoland/add-renovate
Add Renovate config
2026-10-14 16:32:20 +02:00
Paweł Gronowski 433b13a249 Add Renovate config
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-10-14 15:25:17 +02:00
Sebastiaan van Stijn 5c8bfb2844 Merge pull request #7378 from thaJeztah/pr_7371_alt
cli-plugins: Add generic hook messages (alternative)
2026-10-13 17:27:57 +02:00
Paweł Gronowski 528a2ada2e Merge pull request #7375 from thaJeztah/bump_go_winio
vendor: github.com/Microsoft/go-winio v0.6.3
2026-10-13 17:25:25 +02:00
Nicolas Beck de8f4032ad cli-plugins: Add generic hook messages
Allow plugins to return informational messages without the next-steps heading
or indentation. Invoke each hook once and render generic messages before the
shared next-steps block.

Centralize grouping and formatting in PrintMessages, with a callback for
template evaluation and error handling. This avoids the need for an
intermediate EvaluatedMessage type and simplifies hook collection to return
the original responses.

Skip messages containing only whitespace while preserving empty lines
within non-empty messages. Keep PrintNextSteps as a deprecated wrapper
to preserve existing callers and output.

Update the printer tests and remove the obsolete appendMessages helper
and its tests.

Co-authored-by: Nicolas Beck <nicolas.beck@docker.com>
Signed-off-by: Nicolas Beck <nicolas.beck@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-12 16:31:43 +02:00
Sebastiaan van Stijn e4078058de Merge pull request #7373 from TanvirTian/7372-fix-remote-context-download-error
fix: return remote context download errors
2026-10-10 16:03:08 +02:00
Sebastiaan van Stijn 8da8b00555 vendor: github.com/Microsoft/go-winio v0.6.3
- improve interoperability with stdlib sentinel errors and deprecate aliases

full diff: https://github.com/Microsoft/go-winio/compare/f19d9717deb0...v0.6.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-10 15:28:26 +02:00
Tanvir Tian 067d069f0c fix: return remote context download errors
Signed-off-by: Tanvir Tian <beachpilis@gmail.com>
2026-10-10 18:16:02 +06:00
Sebastiaan van Stijn 02fbbf3eb0 Merge pull request #7369 from nico1510/offload-plugin-guidance
cmd/docker: Add guidance for unavailable offload commands
2026-10-09 18:08:27 +02:00
Sebastiaan van Stijn 890976a13b Merge pull request #7370 from thaJeztah/bump_version
Bump version to 29.9.1
2026-10-09 15:12:08 +02:00
Sebastiaan van Stijn 23c66ccd61 Bump version to 29.9.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-09 13:45:39 +02:00
Nicolas Beck 3e686a8b59 cmd/docker: Add guidance for unavailable offload commands
Show installation guidance and a documentation link when the offload
plugin is missing or invalid. Handle this before command execution so
plugin-specific flags and --help also receive the guidance.

Signed-off-by: Nicolas Beck <nicolas.beck@docker.com>
2026-10-09 10:06:48 +00:00
Sebastiaan van Stijn f415da838b Merge pull request #7367 from thaJeztah/bump_trust_deps
cmd/docker-trust: update dependencies
2026-10-08 22:29:49 +02:00
Paweł Gronowski 45c2317672 Merge pull request #7366 from thaJeztah/bump_runewidth
vendor: github.com/mattn/go-runewidth v0.0.31
2026-10-08 22:27:38 +02:00
Paweł Gronowski 8308969eda Merge pull request #7368 from vvoland/update-docker
vendor: github.com/moby/moby/client v0.6.2
2026-10-08 22:26:44 +02:00
Sebastiaan van Stijn cf809998ab cmd/docker-trust: update dependencies
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-08 22:23:38 +02:00
Paweł Gronowski 730c880b35 vendor: github.com/moby/moby/client v0.6.2
full diff: https://github.com/moby/moby/compare/client/v0.6.1...client/v0.6.2

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-10-08 22:08:10 +02:00
Sebastiaan van Stijn e63e4fe498 vendor: github.com/mattn/go-runewidth v0.0.31
- Treat the remaining invisible format controls as zero width
- Treat bidi isolates and other invisible format characters as zero width
- Measure ambiguous Latin letters as one cell in East Asian locales
- Fix width mismatches found by the Hegel property tests
- Recognise CJK locales regardless of charset spelling

full diff: https://github.com/mattn/go-runewidth/compare/v0.0.30...v0.0.31

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-08 21:51:14 +02:00
Paweł Gronowski e7df01fe6e Merge pull request #7361 from thaJeztah/bump_go_connections
vendor: github.com/docker/go-connections v0.8.2
2026-10-08 20:31:48 +02:00
Sebastiaan van Stijn 2e51107855 Merge pull request #7363 from vvoland/update-go
Update to go1.26.9
2026-10-08 20:31:01 +02:00
Paweł Gronowski 949bf401dd vendor: golang.org/x/net v0.60.0
full diff: https://golang.org/x/net/compare/v0.59.0...v0.60.0

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-10-08 20:25:01 +02:00
Paweł Gronowski 9db9802127 Update to go1.26.9
This release includes 15 security fixes following the security policy:

- net/http: HTTP/2 server crash due to HPACK encoder race

  HTTP/2 servers could end up crashing due to inadvertently
  modifying its HPACK encoder concurrently. This happens because the
  server modifies the HPACK encoder from two goroutines without
  synchronization: one uses the encoder to encode a HEADERS frame as part
  of a response sent to a client and the other modifies the encoder's
  table size when handling a SETTINGS frame containing
  SETTINGS_HEADER_TABLE_SIZE that a client sends. A malicious client can
  repeatedly send a request while changing the header table size to crash
  the server.

  Fix this issue by not applying SETTINGS_HEADER_TABLE_SIZE immediately.
  Instead, buffer any SETTINGS_HEADER_TABLE_SIZE received, and only apply
  the new value prior to the next time the server writes a frame.

  Thanks to RyotaK (https://ryotak.net) of GMO Flatt Security Inc. for reporting this issue.

  This is CVE-2026-97032 and Go issue https://go.dev/issue/81867.

- net/http: HTTP/2 server memory exhaustion due to Trailer headers

  When "Trailer" headers are sent by a client, the HTTP server internally
  uses the header values to populate the Request.Trailer map passed to the
  server handler. Because Request.Trailer is a map, each entry incurs
  memory overhead. For HTTP/2 servers, a malicious client can exploit this
  by sending a "Trailer" header that declares a large number of fields,
  causing the server to allocate a disproportionate amount of memory while
  bypassing Server.MaxHeaderValueCount and Server.MaxHeaderBytes limits.
  This exploit is not applicable for HTTP/1 servers, which do not support
  multiplexing a large number of requests over one TCP connection, and
  whose Server.MaxHeaderBytes are calculated differently.

  Server.MaxHeaderValueCount and Server.MaxHeaderBytes limits are now
  applied towards the trailer fields declared in "Trailer" headers.

  Thanks to RyotaK (https://ryotak.net) of GMO Flatt Security Inc. for reporting this issue.

  This is CVE-2026-78659 and Go issue https://go.dev/issue/81857.

- crypto/tls: reject malformed ECH outer extension references

  Multiple ECH outer extension references are not
  permitted under RFC 9849; previously, a client
  could send a well-crafted packet that could
  trigger memory exhaustion in the server process
  by specifying multiple references.

  We now reject these as malformed and curb the
  memory amplification vector as a result.

  This is CVE-2026-97031 and Go issue https://go.dev/issue/81855.

- cmd/go: checksum bypass for golang.org/fips140

  Previously, a user operating inside of a malicious
  Go project that defines a bogus golang.org/fips140
  and operates a malicious GOMODPROXY the user chooses
  to connect to can serve an arbitrary module in its
  place.

  We now unpack the trusted ziphash for the bundled
  golang.org/fips140 module and construct its entry
  in the GOMODCACHE such that it can be verified by
  the toolchain.

  This is CVE-2026-94444 and Go issue https://go.dev/issue/81833.

- cmd/go: checksum database bypass for golang.org/toolchain

  Previously, a user operating inside of a malicious
  Go project that defines a bogus golang.org/toolchain
  go.sum entry and operates a malicious GOMODPROXY the
  user chooses to use can bypass the intended checksum.

  We now ensure that golang.org/toolchain always goes
  to the network for the canonical checksum.

  This is CVE-2026-94447 and Go issue https://go.dev/issue/81834.

- html/template: reset context tracking on consecutive template expressions

  When a JavaScript template literal contains
  consecutive expressions, the context tracking
  state was not properly reset upon entering a
  new expression.

  We now ensure that template-literal expression
  entries correctly reset context variables so all
  subsequent regular expression literals are
  accurately recognized and escaped.

  This is CVE-2026-94448 and Go issue https://go.dev/issue/81821.

- html/template: recognize yield as regexp preceder keyword

  A trusted template author may have previously
  written a valid template wherein the use of
  the yield keyword would not be correctly
  escaped.

  We now ensure that valid keyword uses are
  escaped and non-keyword uses are not escaped.

  This is CVE-2026-97030 and Go issue https://go.dev/issue/81823.

- net/textproto, mime/multipart: memory limit bypass when parsing MIME headers

  Parsing a multipart form could bypass memory limits and read an
  arbitrarily long line into memory when the remaining limit at the
  start of a part was less than 400 bytes.

  Multipart form memory limits are now properly enforced in this situation.

  Thanks to Jakub Ciolek (https://ciolek.dev) for reporting this issue.

  This is CVE-2026-94440 and Go issue https://go.dev/issue/81741.

- net/http: HTTP/1 client connection desynchronization after CONNECT rejection

  When http.Transport sends an HTTP/1 CONNECT request with a non-empty
  Request.Body, it writes the body directly to the connection without
  framing after the request headers. If the server rejects the CONNECT
  request with a non-2xx keep-alive response, Transport returns the
  connection to the idle pool. Because CONNECT requests do not have a
  request body, the server may interpret the trailing body bytes as a
  subsequent pipelined HTTP/1.1 request on the connection, leaving the
  pooled connection desynchronized and causing the next caller that reuses
  it to read the response to the injected request. In reverse proxies
  (including httputil.ReverseProxy) that forward CONNECT requests through
  a shared Transport, this can lead to cross-user response poisoning.

  The HTTP/1 transport now closes a connection after sending a CONNECT
  request, regardless of the response status.

  In addition, ReverseProxy now rejects incoming CONNECT requests
  with a 405 Method Not Allowed response. ReverseProxy has never handled
  CONNECT requests in a useful fashion (it does not convert the
  connection into a bidirectional tunnel), so we do not expect this
  change to negatively affect any current users.

  Thanks to Xclow3n (Rajat Raghav) for reporting this issue.

  This is CVE-2026-56866 and Go issue https://go.dev/issue/81740.

- net/http: HTTP/1 server connection desynchronization after 2xx CONNECT response

  When an HTTP server handler sent a 2xx response to an HTTP/1 CONNECT request
  and returned without hijacking the connection, the server improperly continued
  to read and serve requests from the connection. Since a 2xx response to an
  HTTP/1 CONNECT converts the connection into a tunnel, the server should not
  treat the connection as continuing to contain HTTP.

  The impact of this misbehavior is mostly limited to potential request smuggling,
  where an intermediate proxy considers the data on the connection to be tunneled
  and the server considers it to be HTTP.

  The HTTP/1 server now always closes a connection after responding to a CONNECT
  request, regardless of the response status.

  Thanks to Jakub Ciolek (https://ciolek.dev) for reporting this issue.

  This is CVE-2026-94439 and Go issue https://go.dev/issue/81744.

- net/http: excessive CPU consumption from repeated initial window changes

  A malicious HTTP/2 peer could cause excessive CPU consumption in the
  client or server by opening a large number of streams and then sending
  many small SETTINGS frames containing SETTINGS_INITIAL_WINDOW_SIZE values.

  The HTTP/2 client and server now efficiently handle changes to the
  initial window size (O(1) rather than O(number of streams)).

  Thanks to Jakub Ciolek (https://ciolek.dev) for reporting this issue.

  This is CVE-2026-78669 and Go issue https://go.dev/issue/81742.

- net/http: HTTP/2 transport accepts malformed framing-related headers

  Historically, we have been rather lax about malformed framing-related
  headers in our HTTP/2 implementation, as they cannot interfere with
  HTTP/2 framing. However, this makes it possible for our HTTP/2
  implementation to forward responses containing such headers to an HTTP/1
  client when acting as a reverse proxy. If the HTTP/1 client also does
  not behave strictly enough, this can result in response smuggling.

  We now delete malformed framing-related headers when received by our
  HTTP/2 transport, so they will not be forwarded to a potentially
  vulnerable HTTP/1 client.

  Thanks to TJ Barton for reporting this issue.

  This is CVE-2026-78660 and Go issue https://go.dev/issue/81115.

- os: Root.Mkdir(All) can follow junctions out of the root on Windows

  On Windows, when the target of Root.Mkdir or Root.MkdirAll was a junction
  pointing to an empty location, the operation would create a directory at
  the junction target even when that target was located outside the root.
  This only applies to operations where the last path component is a
  junction (path/to/junction, but not path/junction/target).

  Root.Mkdir and Root.MkdirAll now correctly avoid resolving junctions.

  Thanks to Daniele Ballarini for reporting this issue.

  This is CVE-2026-56857 and Go issue https://go.dev/issue/81739.

- net/http: lack of limit on size of parsed Range headers

  When parsing a Range header containing a large number of small ranges,
  FileServer(FS), ServeContent, and ServeFile(FS) could consume an excessive
  amount of CPU.

  These functions now ignore Range headers containing more than 200 ranges.

  The limit is controlled by the new httpservecontentmaxranges=
  GODEBUG setting. Setting GODEBUG=httpservecontentmaxranges=0
  disables the limit.

  Thanks to Jakub Ciolek (https://ciolek.dev) for reporting this issue.

  This is CVE-2026-78667 and Go issue https://go.dev/issue/81858.

- net/http: double flow control refund on HTTP/2 server streams

  The HTTP/2 server could refund connection-level flow control twice for the same data:
  Once when a client resets a stream (refunding data for any sent-but-unread portion
  of the stream), and again when a request handler reads the buffered data.
  A malicious client could exploit this to bypass the configured connection-level
  flow control limit (MaxReceiveBufferPerConnection). Total buffered data is still
  limited by the concurrent stream limit and stream-level flow control.

  The HTTP/2 server now waits to refund connection-level flow control for reset
  streams until after the request handler is complete.

  Thanks to Ali Sherif (https://www.linkedin.com/in/ali-sherif-13812b276/) for reporting this issue.

  This is CVE-2026-78663 and Go issue https://go.dev/issue/81743.

release notes: https://go.dev/doc/devel/release#go1.26.9

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-10-08 20:19:46 +02:00
Sebastiaan van Stijn 63445d6b70 vendor: github.com/docker/go-connections v0.8.2
v0.8.2

- sockets: preserve configured TLS ALPN protocols
- ci: add dependabot to update actions
- ci: update runners to Ubuntu 26.04
- build(deps): bump actions/checkout from 6.0.2 to 7.0.1
- build(deps): bump actions/setup-go from 6.3.0 to 7.0.0
- build(deps): bump golangci/golangci-lint-action from 9.2.0 to 9.3.0

full diff: https://github.com/docker/go-connections/compare/v0.8.1...v0.8.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-08 16:03:13 +02:00
Paweł Gronowski fdb4ee3e75 Merge pull request #7360 from thaJeztah/bump_ansiterm
vendor: github.com/Azure/go-ansiterm 8c912ac31dd4
2026-10-08 14:40:57 +02:00
Sebastiaan van Stijn 4ae247756e vendor: github.com/Azure/go-ansiterm 8c912ac31dd4
- update minimum go version to go1.17
- update minimum golang.org/x/sys to v0.1.0

full diff: https://github.com/Azure/go-ansiterm/compare/e937bb47801a...8c912ac31dd4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-07 23:56:10 +02:00
Paweł Gronowski e7c0f5c53c Merge pull request #7357 from thaJeztah/bump_runewidth
vendor: github.com/mattn/go-runewidth v0.0.30
2026-10-07 19:28:07 +02:00
Paweł Gronowski 87fb2ebe7e Merge pull request #7359 from vvoland/gha-e2e-master
gha/e2e: Also test against moby master
2026-10-07 19:26:29 +02:00
Paweł Gronowski e8c098c8bf Merge pull request #7358 from nico1510/cloud-plugin-guidance
cmd/docker: Add guidance for unavailable cloud plugins
2026-10-07 19:26:04 +02:00
Nicolas BeckandAllie Sadler 374636ff15 cmd/docker: Add guidance for unavailable cloud plugins
Explain how to install the Offload plugin when --cloud cannot find it,
and link to the cloud flag documentation. Preserve diagnostic details
for invalid or incompatible plugins and limit installation guidance
to Offload.

Use standard default-value handling in the resolution tests to satisfy
the lint complexity limit without changing test coverage.

Co-authored-by: Allie Sadler <102604716+aevesdocker@users.noreply.github.com>
Signed-off-by: Nicolas Beck <nicolas.beck@docker.com>
2026-10-07 16:48:27 +00:00
Paweł Gronowski 862e7e6ad4 gha/e2e: Also test against moby master
Add a "master" engine-version to the e2e matrix to catch regressions
against the upcoming engine release before it reaches an rc.

There is no "master" dind image, so just copy the engine binary from the
moby/moby-bin:master image and put it into the latest dind image.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-10-07 18:25:47 +02:00
Sebastiaan van Stijn 3d2650ce76 Merge pull request #7331 from docker/dependabot/github_actions/codeql-actions-4f351959ed
build(deps): bump the codeql-actions group across 1 directory with 3 updates
2026-10-06 19:31:33 +02:00
Sebastiaan van Stijn e11705385d vendor: github.com/mattn/go-runewidth v0.0.30
- Wrap: measure grapheme clusters, not runes
- Skip grapheme segmentation for text that cannot form clusters
- Keep strings that are not valid UTF-8 on the segmenter - #111
- Take the rune fast path in the Truncate functions too

full diff: https://github.com/mattn/go-runewidth/compare/v0.0.29...v0.0.30

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-06 11:07:44 +02:00
dependabot[bot] fd58705f3a build(deps): bump the codeql-actions group across 1 directory with 3 updates
Bumps the codeql-actions group with 3 updates in the / directory: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action).


Updates `github/codeql-action/init` from 4.38.0 to 4.38.2
- [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/b96794f015dfd88f77b49b1c93e0fa7110f94c63...2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2)

Updates `github/codeql-action/autobuild` from 4.38.0 to 4.38.2
- [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/b96794f015dfd88f77b49b1c93e0fa7110f94c63...2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2)

Updates `github/codeql-action/analyze` from 4.38.0 to 4.38.2
- [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/b96794f015dfd88f77b49b1c93e0fa7110f94c63...2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2)

---
updated-dependencies:
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.38.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
- dependency-name: github/codeql-action/autobuild
  dependency-version: 4.38.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
- dependency-name: github/codeql-action/init
  dependency-version: 4.38.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-06 08:46:12 +00:00
Sebastiaan van Stijn 5e6d8e3ab6 Merge pull request #7356 from nicksieger/cloud-resolver-interactive-input
cmd/docker: Allow interactive cloud context resolution
2026-10-05 23:47:38 +02:00
Nick Sieger 8503a98b68 refactor(cmd/docker): split resolveCloudContext to satisfy gocyclo
- extract setResolverStdio for resolver terminal wiring
- extract validateResolvedContext for context/endpoint checks

Signed-off-by: Nick Sieger <nick@nicksieger.com>
2026-10-05 15:29:43 -05:00
Nicolas Beck 488292ca1f cmd/docker: Allow interactive cloud context resolution
Forward stdin and stderr to cloud context providers when both are
terminals, allowing prompts during --cloud resolution. Pass file handles
directly to preserve terminal detection and leave piped or redirected
input available to the requested command.

Use the standard console handles when Windows terminal wrappers hide
their underlying files. Keep stdout reserved for the JSON response.

Signed-off-by: Nicolas Beck <nicolas.beck@docker.com>
2026-10-05 19:59:25 +00:00
Sebastiaan van Stijn 75d1d1a9e6 Merge pull request #7292 from vvoland/umasktest
Revert "e2e/container: Skip umask test until engine support"
2026-10-03 16:55:33 +02:00
Sebastiaan van Stijn cb192aeb41 Merge pull request #7351 from nicksieger/docker-cloud-build-help-parsing
fix(cli): recognize build/bake/builder aliasing before cloud help check
2026-10-03 11:42:29 +02:00
Nick Sieger 6cb63efe6f fix(cli): recognize build/bake/builder aliasing before cloud help check
docker --cloud build rejected every BuildKit-only flag (--secret, --ssh,
--push, --output, ...) because cloudHelpRequest parsed remaining args
against the legacy build command's flag set before processAliases
rewrites build into a buildx invocation. Treat build/bake/builder/image
build the same as plugin commands: only recognize --help/-h immediately
after the resolved command path instead of validating flags.

Fixes #7350

Signed-off-by: Nick Sieger <nick@nicksieger.com>
2026-10-02 16:52:51 -05:00
Paweł Gronowski 48988f5c12 Merge pull request #7347 from thaJeztah/bump_containerd_logs
vendor: github.com/containerd/log v0.2.0
2026-10-01 22:33:07 +02:00
Sebastiaan van Stijn e3559d29fb Merge pull request #7348 from thaJeztah/bump_client
vendor: github.com/moby/moby/client v0.6.1, moby/api v1.56.1
2026-10-01 22:32:20 +02:00
Paweł Gronowski 4f8ad7605e Merge pull request #7346 from thaJeztah/bump_ansiterm
vendor: github.com/Azure/go-ansiterm e937bb47801a
2026-10-01 22:26:12 +02:00
Sebastiaan van Stijn 886ab250f0 vendor: github.com/moby/moby/client v0.6.1, moby/api v1.56.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-01 22:23:55 +02:00
Sebastiaan van Stijn 58eea06064 vendor: github.com/Azure/go-ansiterm e937bb47801a
full diff: https://github.com/Azure/go-ansiterm/compare/faa5f7b0171c...e937bb47801ae0fd8fb8ff02743f6a93e2b51982

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-01 21:31:49 +02:00
Sebastiaan van Stijn cd7b9082aa Merge pull request #7343 from vvoland/work-cloud
cmd/docker: Add --cloud with configurable context resolution
2026-10-01 20:56:40 +02:00
Paweł Gronowski fb1cc07c08 cmd/docker: Add --cloud with configurable context resolution
Resolve it through the offload plugin by default, with a provider
override in features.cloud in the Docker config.

Require the selected plugin to declare the cloud-context-resolver
feature in its metadata before showing the flag in help and completion
or invoking its __resolve-context operation.

Resolve through WithContextResolver, after the config file and context
store are loaded but before client initialization, without wrapping or
re-executing Docker.

Forward --context to downstream plugins so they need not support
--cloud or repeat provisioning. Skip provisioning for help, version,
and completion requests. Report unknown flags and missing flag values
before provisioning, so a mistyped invocation fails without creating
cloud resources or contacting the engine selected before resolution.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-10-01 20:17:44 +02:00
Sebastiaan van Stijn 482a140ce7 Merge pull request #7345 from thaJeztah/bump_go_winio
vendor: github.com/Microsoft/go-winio f19d9717deb0
2026-10-01 20:00:59 +02:00
Sebastiaan van Stijn 0123ab82cc Merge pull request #7308 from thaJeztah/bump_compress
vendor: github.com/klauspost/compress v1.20.1
2026-10-01 19:46:10 +02:00
Sebastiaan van Stijn 3caafba34f vendor: github.com/containerd/log v0.2.0
full diff: https://github.com/containerd/log/compare/v0.1.0...v0.2.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-01 19:44:52 +02:00
Sebastiaan van Stijn 07339fa78f vendor: github.com/klauspost/compress v1.20.1
full diff: https://github.com/klauspost/compress/compare/v1.20.0...v1.20.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-01 19:34:03 +02:00
Sebastiaan van Stijn 637be3d60c vendor: github.com/klauspost/compress v1.20.0
- Add lzw reader/writer
- ci: test against go1.27.x, drop go1.24.x
- flate: Writer L7-9 with dictionary can emit the dictionary to stream
- gzhttp: limit jitter hash to jitterBuffer bytes
- s2: arm64 assembly encoders, lowered from the amd64 avo program
- s2: clamp the Go EncodeBetter skip to match the assembly
- xpress: add Microsoft XPRESS (MS-XCA) decompression
- xxhash: bound input of non-preemptive assembly
- zstd, huff0: improved arm64 lowering, and narrow two table loads to MOVWQZX
- zstd/huff0: break false partial-register dependencies in seqdec/4X decoders
- zstd/huff0: fold two ISA-gap x86 idioms in the avo arm64 lowering

full diff: https://github.com/klauspost/compress/compare/v1.19.2...v1.20.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-01 19:33:28 +02:00
Sebastiaan van Stijn 6868874c98 vendor: github.com/Microsoft/go-winio f19d9717deb0
full diff: https://github.com/Microsoft/go-winio/compare/v0.6.2...f19d9717deb0a33bb37c3580481dd1909782fc03

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-01 19:29:12 +02:00
Paweł Gronowski 0932e7d9a8 Merge pull request #7344 from vvoland/process-release
Bump version to 29.9.0
2026-10-01 19:08:56 +02:00
Paweł Gronowski b53372e86a cli/command: Add WithContextResolver to override context selection
Callers that choose the context from configuration had to do it before
Initialize. That meant loading the config file and context store
themselves and handling --config a second time.

WithContextResolver runs a callback inside Initialize after the config
file and context store are loaded, but before telemetry and endpoint
initialization. A non-empty result replaces the selected context, an
empty result keeps normal selection, and an error aborts
initialization.

The API client and endpoint are resolved lazily, so they use the
overridden context.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-10-01 19:04:26 +02:00
Paweł Gronowski b1f2c1dc06 cli-plugins/metadata: Add Features for optional plugin contracts
Plugins had no generic way to declare support for optional CLI
contracts, so each one would need its own top-level metadata field.

Add Features, keyed by feature name. Values are arbitrary JSON so a
feature can carry more than a boolean.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-10-01 19:04:25 +02:00
Paweł Gronowski d6bc11318d Bump version to 29.9.0
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-10-01 18:58:38 +02:00
Paweł Gronowski eabc65846b Merge tag 'v29.8.1' into 29.x
v29.8.1
2026-09-29 14:09:44 +02:00
Paweł Gronowski b873f57cd0 Merge tag 'v29.8.0' into 29.x
v29.8.0
2026-09-29 14:09:44 +02:00
Paweł Gronowski c8a849c2f9 Merge tag 'v29.8.0-rc.1' into 29.x
v29.8.0-rc.1
2026-09-29 14:09:44 +02:00
Sebastiaan van Stijn 7fc2dff9bc Merge pull request #7325 from docker/dependabot/github_actions/codecov/codecov-action-7.1.1
build(deps): bump codecov/codecov-action from 7.0.0 to 7.1.1
2026-09-23 11:45:10 +02:00
dependabot[bot] ca5a266c81 build(deps): bump codecov/codecov-action from 7.0.0 to 7.1.1
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 7.0.0 to 7.1.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/fb8b3582c8e4def4969c97caa2f19720cb33a72f...303a32d7a59b442fa8d48b6a1cc6825c09c847a5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 7.1.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-23 08:47:11 +00:00
Sebastiaan van Stijn 39f182cbaa Merge pull request #7323 from docker/dependabot/github_actions/docker-actions-72067bac81
build(deps): bump the docker-actions group with 3 updates
2026-09-23 01:10:38 +02:00
Sebastiaan van Stijn 0684ae0cc1 Merge pull request #7311 from docker/dependabot/github_actions/codeql-actions-f545b4e0f6
build(deps): bump the codeql-actions group across 1 directory with 3 updates
2026-09-23 01:09:09 +02:00
dependabot[bot] b7dc94c65f build(deps): bump the codeql-actions group across 1 directory with 3 updates
Bumps the codeql-actions group with 3 updates in the / directory: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action).


Updates `github/codeql-action/init` from 4.37.9 to 4.38.0
- [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/cdf488f595d80d6e07e03d4674febd5ab45fa938...b96794f015dfd88f77b49b1c93e0fa7110f94c63)

Updates `github/codeql-action/autobuild` from 4.37.9 to 4.38.0
- [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/cdf488f595d80d6e07e03d4674febd5ab45fa938...b96794f015dfd88f77b49b1c93e0fa7110f94c63)

Updates `github/codeql-action/analyze` from 4.37.9 to 4.38.0
- [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/cdf488f595d80d6e07e03d4674febd5ab45fa938...b96794f015dfd88f77b49b1c93e0fa7110f94c63)

---
updated-dependencies:
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.38.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: codeql-actions
- dependency-name: github/codeql-action/autobuild
  dependency-version: 4.38.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: codeql-actions
- dependency-name: github/codeql-action/init
  dependency-version: 4.38.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: codeql-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-22 08:45:09 +00:00
dependabot[bot] 12566dd80d build(deps): bump the docker-actions group with 3 updates
Bumps the docker-actions group with 3 updates: [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action), [docker/bake-action](https://github.com/docker/bake-action) and [docker/docker-agent-action/.github/workflows/review-pr.yml](https://github.com/docker/docker-agent-action).


Updates `docker/setup-buildx-action` from 4.3.0 to 4.4.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/37fe631027851001ddb9b187196cc803df7f5f0e...594f3bf4285d9ea8dc53c9a0c9c4092420091003)

Updates `docker/bake-action` from 7.3.0 to 7.4.0
- [Release notes](https://github.com/docker/bake-action/releases)
- [Commits](https://github.com/docker/bake-action/compare/d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b...018cb6412ab401ebaa809aa5f85966b74628600f)

Updates `docker/docker-agent-action/.github/workflows/review-pr.yml` from 2.0.8 to 2.0.9
- [Release notes](https://github.com/docker/docker-agent-action/releases)
- [Commits](https://github.com/docker/docker-agent-action/compare/c3d5c9b1517c670f468086c577b8339ce2344b5e...3654ec391b070e247de2e2e3c1ff2519b6378b3a)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker-actions
- dependency-name: docker/bake-action
  dependency-version: 7.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker-actions
- dependency-name: docker/docker-agent-action/.github/workflows/review-pr.yml
  dependency-version: 2.0.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-22 08:43:27 +00:00
Sebastiaan van Stijn 4167943209 Merge pull request #7320 from docker/dependabot/github_actions/docker-actions-67f84ccd89
build(deps): bump docker/docker-agent-action/.github/workflows/review-pr.yml from 2.0.7 to 2.0.8 in the docker-actions group
2026-09-21 19:04:50 +02:00
Paweł Gronowski 9dcf8afb5d Merge pull request #7322 from thaJeztah/bump_version
update version to 29.8.2
2026-09-21 19:00:39 +02:00
Sebastiaan van Stijn 6fdced88c5 update version to 29.8.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-21 18:22:19 +02:00
dependabot[bot] 0a563b177a build(deps): bump docker/docker-agent-action/.github/workflows/review-pr.yml
Bumps the docker-actions group with 1 update: [docker/docker-agent-action/.github/workflows/review-pr.yml](https://github.com/docker/docker-agent-action).


Updates `docker/docker-agent-action/.github/workflows/review-pr.yml` from 2.0.7 to 2.0.8
- [Release notes](https://github.com/docker/docker-agent-action/releases)
- [Commits](https://github.com/docker/docker-agent-action/compare/bd672e0d95c61bb79e899f1ea71d44e19b12f91f...c3d5c9b1517c670f468086c577b8339ce2344b5e)

---
updated-dependencies:
- dependency-name: docker/docker-agent-action/.github/workflows/review-pr.yml
  dependency-version: 2.0.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-21 08:42:49 +00:00
Paweł Gronowski 4a63305d74 Merge pull request #7297 from docker/dependabot/github_actions/docker-actions-4dc0240351
build(deps): bump docker/docker-agent-action/.github/workflows/review-pr.yml from 2.0.5 to 2.0.7 in the docker-actions group across 1 directory
2026-09-15 13:21:13 +02:00
Paweł Gronowski 87ff477cb6 Merge pull request #7307 from thaJeztah/ci_ubuntu_2604
ci: update to Ubuntu 26.04 runners
2026-09-15 11:25:06 +02:00
Sebastiaan van Stijn 101ffc09eb ci: update to Ubuntu 26.04 runners
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-15 10:53:44 +02:00
dependabot[bot] 32ff1e7281 build(deps): bump docker/docker-agent-action/.github/workflows/review-pr.yml
Bumps the docker-actions group with 1 update in the / directory: [docker/docker-agent-action/.github/workflows/review-pr.yml](https://github.com/docker/docker-agent-action).


Updates `docker/docker-agent-action/.github/workflows/review-pr.yml` from 2.0.5 to 2.0.7
- [Release notes](https://github.com/docker/docker-agent-action/releases)
- [Commits](https://github.com/docker/docker-agent-action/compare/06e1767af06263c93d712449cbf859778d9392ee...bd672e0d95c61bb79e899f1ea71d44e19b12f91f)

---
updated-dependencies:
- dependency-name: docker/docker-agent-action/.github/workflows/review-pr.yml
  dependency-version: 2.0.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-15 08:42:59 +00:00
Sebastiaan van Stijn d146e672a6 Merge pull request #7290 from vvoland/port-template
github: Port Moby pull request template
2026-09-14 21:05:21 +02:00
Paweł Gronowski ac976d9edb Merge pull request #7296 from keeltrace/keeltrace/history-timezone-test
cli/image: make history test timezone-independent
2026-09-14 18:09:19 +02:00
Paweł Gronowski 48baf6c322 Merge pull request #7306 from thaJeztah/bump_x_deps
vendor: update golang.org/x/* deps
2026-09-14 18:05:00 +02:00
Paweł Gronowski 47a06aa077 Merge pull request #7293 from thaJeztah/bump_uax29
vendor: github.com/clipperhouse/uax29/v2 v2.7.0
2026-09-14 18:03:28 +02:00
Paweł Gronowski 1bf3eb68ce Merge pull request #7295 from thaJeztah/bump_userns
vendor: github.com/moby/sys/userns v0.2.1
2026-09-14 18:03:05 +02:00
Sebastiaan van Stijn 60dffc9412 vendor: golang.org/x/net v0.59.0
Notable changes:

- all: upgrade go directive to at least 1.26.0
- http2: deprecate Transport and Server
- http2: use IDNA Lookup profile, not raw Punycode translation
    - addresses https://github.com/golang/go/issues/81010
- internal/httpcommon: remove Host header from server request

full diff: https://github.com/golang/net/compare/v0.58.0...v0.59.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-14 17:31:14 +02:00
Sebastiaan van Stijn b0a6803f9b vendor: golang.org/x/term v0.46.0
- all: upgrade go directive to at least 1.26.0
- term: process bytes returned with a read error
    - fixes: x/term: ReadLine discards data returned with io.EOF

full diff: https://github.com/golang/term/compare/v0.45.0...v0.46.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-14 17:30:22 +02:00
Sebastiaan van Stijn f90c2894a8 vendor: golang.org/x/text v0.42.0
full diff: https://github.com/golang/text/compare/v0.41.0...v0.42.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-14 17:29:43 +02:00
Sebastiaan van Stijn ed4de7d484 vendor: golang.org/x/time v0.16.0
- all: upgrade go directive to at least 1.26.0

full diff: https://github.com/golang/time/compare/v0.15.0...v0.16.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-14 17:28:24 +02:00
Sebastiaan van Stijn 74b7f5cf27 vendor: golang.org/x/mod v0.41.0
- all: upgrade go directive to at least 1.26.0

full diff: https://github.com/golang/mod/compare/v0.40.0...v0.41.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-14 17:27:47 +02:00
Sebastiaan van Stijn 824b68911b vendor: golang.org/x/sys v0.48.0
- cpu: add ppc64le POWER10 detection
- cpu: add basic support for GOARCH=sparc64
- cpu: disable AVX+ on netbsd/amd64
  relates to "runtime: async preemption corrupts AVX (YMM) state on netbsd/amd64"
- internal/cpu: detect RISC-V VLENB when the vector extension is available
- unix: add missing HWTSTAMP_* constants
- unix: add pidfd constants and type
- unix: add IoctlPidfdInfo
- unix: add IPMI interface
- unix: align Ifreq so its union accessors cannot fault
- unix: stop generating sparc termbits from the generic header
- windows: add SO_SNDTIMEO constant for socket options

full diff: https://github.com/golang/sys/compare/v0.47.0...v0.48.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-14 17:27:10 +02:00
Sebastiaan van Stijn dbad17f16f vendor: golang.org/x/sync v0.23.0
- all: upgrade go directive to at least 1.26.0
- semaphore: panic on negative capacity

full diff: https://github.com/golang/sync/compare/v0.22.0...v0.23.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-14 17:26:27 +02:00
KeelTrace eb8fab8023 cli/image: make history test timezone-independent
Signed-off-by: KeelTrace <218190424+keeltrace@users.noreply.github.com>
2026-09-12 10:01:56 -07:00
Sebastiaan van Stijn 7b322e4dc2 vendor: github.com/moby/sys/userns v0.2.1
userns: fix user-namespace detection on OpenVZ, where namespace inode
numbers are virtualized.

full diff: https://github.com/moby/sys/userns/compare/v0.2.0...v0.2.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-08 20:27:04 +02:00
Sebastiaan van Stijn 676ca0067b vendor: github.com/clipperhouse/uax29/v2 v2.7.0
- Adds Unicode 17 support
- Fast paths for ASCII
- ANSI escape sequences as grapheme clusters
- Implement UTF-8 C1 control sequences
- Implement 8-bit ANSI

Breaking change

The returned iterator type from FromString() and FromBytes() is now a pointer.
This will not present a problem if you are just using it in the typical way,
which is assigning to a local variable and iterating.

If you are embedding this iterator into another object, and therefore declaring
its type, this change might break your compilation. You’ll need to change to a
pointer type. Apologies if so — this seems like a small enough change that a
v3 would be a bit much.

full diff: https://github.com/clipperhouse/uax29/compare/v2.2.0...v2.7.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-07 09:21:26 +02:00
Paweł Gronowski e8bb7f7c81 e2e/container: Gate umask test on API support
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-04 16:06:32 +02:00
Paweł Gronowski 3ee4c06af6 Revert "e2e/container: Skip umask test until engine support"
This reverts commit 45a3e0bc2a.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-04 15:57:17 +02:00
Paweł Gronowski ab989d8316 github: Port Moby pull request template
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-04 14:42:18 +02:00
Paweł Gronowski d306b9d600 Merge pull request #7287 from thaJeztah/bump_runewidth
vendor: github.com/mattn/go-runewidth v0.0.29
2026-09-04 14:40:50 +02:00
Paweł Gronowski 0ffb4c4e0b Merge pull request #7289 from thaJeztah/bump_cdi
vendor: tags.cncf.io/container-device-interface v1.1.1
2026-09-04 14:40:31 +02:00
Sebastiaan van Stijn e914d34ac3 vendor: tags.cncf.io/container-device-interface v1.1.1
removes some transitive dependencies

full diff: https://github.com/cncf-tags/container-device-interface/compare/v1.1.0...v1.1.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-04 11:35:43 +02:00
Sebastiaan van Stijn a6538bea40 Merge pull request #7286 from thaJeztah/bump_version
update version to 29.8.1
2026-09-04 00:48:15 +02:00
Paweł Gronowski 88096ef005 Merge pull request #7288 from thaJeztah/bump_jose
vendor: github.com/go-jose/go-jose/v4 v4.1.5
2026-09-03 23:47:32 +02:00
Sebastiaan van Stijn c50ce17c19 vendor: github.com/go-jose/go-jose/v4 v4.1.5
Fixed security issues

- cipher/cbc_hmac: don't panic on empty ciphertext
- cipher/cbc_hmac: don't panic on invalid key
- json: limit stack depth
- jwt: reject out-of-range NumericDate values
- Check alg against pubkey curve during verify.
- Reject malformed Ed25519 JWKs
- jws: choose verification key per-signature

Changed

- Verify OpaqueSigner's Public() return is public
- jws: skip signature on ErrJWKSKidNotFound
- Handle JWE JSON without protected header
- jws: don't strip internal whitespace before parsing JSON
- jws: fewer calls to OpaqueSigner.Public()
- Return a specific error when parsing empty string
- Reject typed nil at Verify time

full diff: https://github.com/go-jose/go-jose/compare/v4.1.4...v4.1.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-03 23:40:55 +02:00
Sebastiaan van Stijn 441acb383d vendor: github.com/mattn/go-runewidth v0.0.29
- Wrap: do not panic when the width is zero
- CreateLUT: rebuild the table after a DefaultCondition flag change

full diff: https://github.com/mattn/go-runewidth/compare/v0.0.28...v0.0.29

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-03 23:35:43 +02:00
Sebastiaan van Stijn cec24c7b9a Merge pull request #7285 from vvoland/update-docker
vendor: github.com/moby/moby/api v1.56.0 & client v0.6.0
2026-09-03 23:11:32 +02:00
Sebastiaan van Stijn ed68c49095 update version to 29.8.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-03 23:09:28 +02:00
Paweł Gronowski d5ea3bdc8a vendor: github.com/moby/moby/client v0.6.0
full diff: https://github.com/moby/moby/compare/b9b109e4d341...client/v0.6.0

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-03 23:01:04 +02:00
Paweł Gronowski 7cf09ba485 vendor: github.com/moby/moby/api v1.56.0
full diff: https://github.com/moby/moby/compare/b9b109e4d341...api/v1.56.0

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-03 23:00:14 +02:00
Sebastiaan van Stijn 6239084af1 Merge pull request #7108 from zhangyoufu/umask
cli/command/container: add create/run --umask
2026-09-03 22:34:00 +02:00
Paweł Gronowski 45a3e0bc2a e2e/container: Skip umask test until engine support
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-03 22:12:34 +02:00
Paweł Gronowski 79dd1f4ad0 Merge pull request #7284 from thaJeztah/trust_bump
cmd/docker-trust: update dependencies and fix test
2026-09-03 21:56:58 +02:00
Sebastiaan van Stijn 32bfe54148 cmd/docker-trust: update dependencies
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-03 21:50:34 +02:00
Sebastiaan van Stijn d7036970e8 cmd/docker-trust: fix tests
Some test-files were missing.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-03 21:50:34 +02:00
Sebastiaan van Stijn ade907089f Merge pull request #7196 from locker95/docs/global-mode-constraints
docs(service create): note global mode still honors constraints
2026-09-03 21:31:46 +02:00
Sebastiaan van Stijn e92e07589b Merge pull request #7171 from locker95/locker95-docs-system-prune-build-cache
docs: mention build cache in docker system prune description
2026-09-03 21:30:52 +02:00
Youfu Zhang 09d30a34bf cli/command/container: add create/run --umask
Signed-off-by: Youfu Zhang <zhangyoufu@gmail.com>
2026-09-04 03:23:44 +08:00
Sebastiaan van Stijn 51780c0691 Merge pull request #7281 from vvoland/update-docker
vendor: github.com/moby/moby/api v1.56.0-dev (b9b109e4d341)
2026-09-03 21:18:54 +02:00
Paweł Gronowski fee40c1660 Merge pull request #7218 from locker95/docs/history-platform-example
docs(history): use the pulled platform in the --platform example
2026-09-03 21:12:40 +02:00
Paweł Gronowski 91fc8ad4a2 vendor: github.com/moby/moby/client v0.5.2-dev (b9b109e4d341)
full diff: https://github.com/moby/moby/compare/client/v0.5.1...b9b109e4d341

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-03 20:52:14 +02:00
Paweł Gronowski cb6c7bc03f vendor: github.com/moby/moby/api v1.56.0-dev (b9b109e4d341)
full diff: https://github.com/moby/moby/compare/api/v1.55.0...b9b109e4d341

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-03 20:40:38 +02:00
Sebastiaan van Stijn b1b8a602f6 Merge pull request #7269 from thaJeztah/slice_and_dice_step2
update naturalsort sorting with slice
2026-09-03 15:28:39 +02:00
Sebastiaan van Stijn 36e01adcfa cmd/docker-trust: update naturalsort sorting with slices
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-03 15:02:50 +02:00
Sebastiaan van Stijn e54eb133cb update naturalsort sorting with slices
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-03 15:02:45 +02:00
Paweł Gronowski f01f978aca Merge pull request #7267 from thaJeztah/fix_aliases
cmd/docker: fix stringSliceReplaceAt with overlapping matches
2026-09-03 15:00:28 +02:00
Paweł Gronowski d078f15f2b Merge pull request #7254 from locker95/fix/login-client-side-basic-401
registry: treat basic-auth 401 as unauthorized
2026-09-03 14:30:05 +02:00
Paweł Gronowski 13e32611b5 Merge pull request #7271 from thaJeztah/bump_sortorder
vendor: github.com/fvbommel/sortorder v1.2.0
2026-09-03 14:22:45 +02:00
Sebastiaan van Stijn 7c883814b8 Merge pull request #7280 from vvoland/work-panic
cli/command: Avoid panics after client initialization errors
2026-09-03 13:03:29 +02:00
Paweł Gronowski b07de47694 cli/command: Avoid panics after client initialization errors
When client.New rejects an invalid Docker host or other client option,
it returns a nil concrete client with an error.

Returning that pointer directly as client.APIClient stores a typed-nil
interface, so lazy version checks dereference it.

Return an error instead.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-03 10:59:11 +02:00
Sebastiaan van Stijn 9878ff214b Merge pull request #7274 from vvoland/update-go
Update to go1.26.8
2026-09-02 16:43:01 +02:00
Paweł Gronowski c24195d63f Update to go1.26.8
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-02 14:48:59 +02:00
Sebastiaan van Stijn d7ad1d7268 Merge pull request #7272 from docker/dependabot/github_actions/codeql-actions-9de84475bd
build(deps): bump the codeql-actions group with 3 updates
2026-09-02 12:48:04 +02:00
Paweł Gronowski e6ee8bee34 Merge pull request #7268 from thaJeztah/slice_and_dice
modernize code with slices and maps packages
2026-09-02 12:11:22 +02:00
dependabot[bot] c096bd1261 build(deps): bump the codeql-actions group with 3 updates
Bumps the codeql-actions group with 3 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action).


Updates `github/codeql-action/init` from 4.37.8 to 4.37.9
- [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/db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28...cdf488f595d80d6e07e03d4674febd5ab45fa938)

Updates `github/codeql-action/autobuild` from 4.37.8 to 4.37.9
- [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/db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28...cdf488f595d80d6e07e03d4674febd5ab45fa938)

Updates `github/codeql-action/analyze` from 4.37.8 to 4.37.9
- [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/db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28...cdf488f595d80d6e07e03d4674febd5ab45fa938)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.37.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
- dependency-name: github/codeql-action/autobuild
  dependency-version: 4.37.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.37.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-02 08:46:18 +00:00
Sebastiaan van Stijn 3014a55736 cmd/docker-trust: update github.com/fvbommel/sortorder v1.2.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-02 09:43:02 +02:00
Sebastiaan van Stijn 3cb9f1cb86 vendor: github.com/fvbommel/sortorder v1.2.0
full diff: https://github.com/fvbommel/sortorder/compare/v1.1.0...v1.2.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-02 09:41:54 +02:00
Sebastiaan van Stijn fd25e9699e Merge pull request #7260 from docker/dependabot/github_actions/docker-actions-cc537b3931
build(deps): bump docker/docker-agent-action/.github/workflows/review-pr.yml from 2.0.4 to 2.0.5 in the docker-actions group across 1 directory
2026-09-02 09:32:08 +02:00
Sebastiaan van Stijn e480e6c6fc volume create: simplify cluster volume options
Extract construction of the cluster volume spec from runCreate, and use
struct literals for the individual cluster volume options.

Also simplify topology parsing by reusing ConvertKVStringsToMap, use
slices.SortFunc for deterministic secret ordering, and use max to clamp
negative capacity values to zero.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-02 02:50:28 +02:00
Sebastiaan van Stijn 977d999382 cli/config: use filepath.IsLocal to validate config paths
Use filepath.Rel and filepath.IsLocal instead of comparing path prefixes
as strings when checking that a path stays within the config directory.

Also avoid calling Dir multiple times when constructing and validating
the path.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-02 02:50:28 +02:00
Sebastiaan van Stijn 64484430f4 cli-plugins: modernize with slices and maps packages
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-02 02:50:28 +02:00
Sebastiaan van Stijn 7631c67208 e2e: modernize
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-02 02:50:28 +02:00
Sebastiaan van Stijn b1780e06a0 opts: modernize with slices and maps packages
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-02 02:50:27 +02:00
Sebastiaan van Stijn 6ea81b3e2e templates: modernize with slices and maps packages
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-02 02:50:27 +02:00
Sebastiaan van Stijn 33d586d81f cli/compose: modernize with slices and maps packages
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-02 02:50:27 +02:00
Sebastiaan van Stijn ed406be52e cli/command: modernize with slices and maps packages
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-02 02:50:27 +02:00
Sebastiaan van Stijn be607d1163 Merge pull request #7227 from kawmy/7226-preserve-mount-order
cli/command/service: preserve mount order on force update
2026-09-02 02:40:47 +02:00
Sebastiaan van Stijn f838c7c84b cmd/docker-trust: modernize with slices and maps packages
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-02 01:28:55 +02:00
Sebastiaan van Stijn bcc4be9f8b cmd/docker: fix stringSliceReplaceAt with overlapping matches
Inline the sub-slice lookup into stringSliceReplaceAt and use
slices.Equal to compare candidate ranges. When a specific index is
required, check that position directly instead of searching the full
slice.

This also fixes overlapping matches and uses slices.Concat to construct
the replacement result.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-01 21:30:59 +02:00
Sebastiaan van Stijn f0f38d5cb9 cmd/docker: rewrite TestStringSliceReplaceAt to table test
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-01 21:30:58 +02:00
Dean Chen b4189c2f7f registry: map login HTTP status through errhttp.ToNative
translateV2AuthError only unwraps a url.Error from Do(); a 401
status never went through it. Use errhttp.ToNative so Auth()
treats that 401 as unauthorized and stops.

Signed-off-by: Dean Chen <862469039@qq.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-09-01 17:24:38 +02:00
Sebastiaan van Stijn 4a9a0ab3aa Merge pull request #7265 from vvoland/docs-dockerd
dockerd: Document new options
2026-09-01 17:10:11 +02:00
Paweł Gronowski 7b7eb0ef6b dockerd: Document custom AppArmor profiles
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-01 16:53:25 +02:00
Paweł Gronowski a458c3871c dockerd: Document default-stop-timeout
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-01 16:30:31 +02:00
Sebastiaan van Stijn dc67811426 Merge pull request #6976 from olabie2/6973-print-error-before-plugin-hooks
cmd/docker: print command error before running plugin hooks
2026-09-01 13:42:53 +02:00
dependabot[bot] 1164af3e60 build(deps): bump docker/docker-agent-action/.github/workflows/review-pr.yml
Bumps the docker-actions group with 1 update in the / directory: [docker/docker-agent-action/.github/workflows/review-pr.yml](https://github.com/docker/docker-agent-action).


Updates `docker/docker-agent-action/.github/workflows/review-pr.yml` from 2.0.4 to 2.0.5
- [Release notes](https://github.com/docker/docker-agent-action/releases)
- [Commits](https://github.com/docker/docker-agent-action/compare/b08367e7e9a471822464be2bb9fdaa1c0fb6061b...06e1767af06263c93d712449cbf859778d9392ee)

---
updated-dependencies:
- dependency-name: docker/docker-agent-action/.github/workflows/review-pr.yml
  dependency-version: 2.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-01 08:41:28 +00:00
Mohammed Olabie cffd24dea4 cmd/docker: print command error before running plugin hooks
Plugin hook output (such as Gordon's "What's next:" hint) was rendered
before the command's own error message because hooks were invoked inside
runDocker while the error was only printed in main() after runDocker
returned.

Print the error to stderr before invoking the hooks, and replace the
error with a status-only StatusError so main() does not print the same
message a second time. The original error message is captured up-front
and still passed to the plugin hooks.

The inline error-printing block in runDocker is extracted into a
printCommandError helper so the new behavior can be unit-tested
directly without spinning up runDocker.

TestPrintCommandError covers each branch of the helper: nil error,
generic error (printed and replaced with StatusError), StatusError
with/without message, context.Canceled (raw and wrapped), and
errCtxSignalTerminated.

Signed-off-by: Mohammed Olabie <olabiedev@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-31 19:20:27 +02:00
Sebastiaan van Stijn 5a7e00d7c2 Merge pull request #7250 from FrancescoCastaldi/fix/2761-zsh-plugins-completion
completion: fix zsh __docker_plugins bad math expression
2026-08-31 18:32:06 +02:00
FrancescoCastaldi 63da0b015b completion: fix zsh __docker_plugins bad math expression
Use 'docker plugin ls --format' to extract plugin names and IDs, escaping colons in the plugin name (e.g. repo:tag) so zsh _describe treats the ID correctly as description.

Fixes #2761

Signed-off-by: FrancescoCastaldi <francesco.castaldi@mapsgroup.it>
2026-08-31 17:24:39 +02:00
Paweł Gronowski cef1e66947 Merge pull request #7256 from thaJeztah/bump_go_events
vendor: github.com/docker/go-events v0.1.0
2026-08-28 21:50:23 +02:00
Paweł Gronowski 52611d0d6a Merge pull request #7257 from thaJeztah/bump_compress
vendor: github.com/klauspost/compress v1.19.2
2026-08-28 21:50:14 +02:00
Paweł Gronowski 6292b73b99 Merge pull request #7255 from thaJeztah/bump_credshelper
vendor: github.com/docker/docker-credential-helpers v0.9.9
2026-08-28 21:50:12 +02:00
Sebastiaan van Stijn 84d70fbdc3 Merge pull request #7258 from thaJeztah/bump_go126
update minimum go version to go1.26 and go fix
2026-08-28 21:48:36 +02:00
Sebastiaan van Stijn 4239f5d121 go fix (omitzero)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-28 21:21:39 +02:00
Sebastiaan van Stijn be9ca38f8b go fix for go1.26
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-28 21:21:35 +02:00
Sebastiaan van Stijn 8eb66b47e3 update minimum go version to go1.26
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-28 20:46:02 +02:00
Sebastiaan van Stijn 76b505b054 vendor: github.com/klauspost/compress v1.19.2
full diff: https://github.com/klauspost/compress/compare/v1.18.7...v1.19.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-28 20:36:33 +02:00
Sebastiaan van Stijn 65b90d8888 vendor: github.com/docker/go-events v0.1.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-28 20:33:30 +02:00
Sebastiaan van Stijn 0f0e561a3f vendor: github.com/docker/docker-credential-helpers v0.9.9
full diff: https://github.com/docker/docker-credential-helpers/compare/v0.9.8...v0.9.9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-28 20:31:43 +02:00
Sebastiaan van Stijn 573a46e506 Merge pull request #7223 from vvoland/fix-review
gha: Grant PR review permissions required by v2.0.3
2026-08-28 12:41:48 +02:00
Sebastiaan van Stijn 433ab01649 Merge pull request #7252 from docker/dependabot/github_actions/codeql-actions-f442528237
build(deps): bump the codeql-actions group with 3 updates
2026-08-28 12:40:53 +02:00
Sebastiaan van Stijn 175b4e0a98 Merge pull request #7253 from docker/dependabot/github_actions/docker-actions-93f31bce83
build(deps): bump docker/github-builder/.github/workflows/bake.yml from 1.16.0 to 1.17.0 in the docker-actions group
2026-08-28 12:40:07 +02:00
Dean Chen 5e0fdb3f6e registry: treat basic-auth 401 as unauthorized
Client-side login (daemon down) was wrapping a 401 as a plain error, so
Auth() moved on to the next endpoint. That can print Login Succeeded if
the HTTP fallback happens to answer 200.

Fixes #7237

Signed-off-by: Dean Chen <862469039@qq.com>
2026-08-28 14:53:19 +05:00
dependabot[bot] 00de141abf build(deps): bump docker/github-builder/.github/workflows/bake.yml
Bumps the docker-actions group with 1 update: [docker/github-builder/.github/workflows/bake.yml](https://github.com/docker/github-builder).


Updates `docker/github-builder/.github/workflows/bake.yml` from 1.16.0 to 1.17.0
- [Release notes](https://github.com/docker/github-builder/releases)
- [Commits](https://github.com/docker/github-builder/compare/a492c6d04fd3315f67230809b44d60cc0acd50b3...58cb9f5b71b1836d6f690c1e95effdeb9b98cb8a)

---
updated-dependencies:
- dependency-name: docker/github-builder/.github/workflows/bake.yml
  dependency-version: 1.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-28 08:45:50 +00:00
dependabot[bot] 1f46660e37 build(deps): bump the codeql-actions group with 3 updates
Bumps the codeql-actions group with 3 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action).


Updates `github/codeql-action/init` from 4.37.7 to 4.37.8
- [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/ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd...db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28)

Updates `github/codeql-action/autobuild` from 4.37.7 to 4.37.8
- [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/ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd...db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28)

Updates `github/codeql-action/analyze` from 4.37.7 to 4.37.8
- [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/ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd...db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.37.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
- dependency-name: github/codeql-action/autobuild
  dependency-version: 4.37.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.37.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-28 08:45:25 +00:00
Paweł Gronowski ff3273f3e4 Merge pull request #7243 from thaJeztah/bump_go_metrics
vendor: github.com/docker/go-metrics v0.1.0
2026-08-27 18:50:25 +02:00
Paweł Gronowski 6fccf35355 Merge pull request #7246 from thaJeztah/bump_userns
vendor: github.com/moby/sys/userns v0.2.0
2026-08-27 18:50:15 +02:00
Paweł Gronowski 511f136927 Merge pull request #7247 from thaJeztah/bump_connections
vendor: github.com/docker/go-connections v0.8.1
2026-08-27 18:50:05 +02:00
Sebastiaan van Stijn b17df8fea3 vendor: github.com/docker/go-connections v0.8.1
fixes support for BSD variants

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-27 17:06:54 +02:00
Sebastiaan van Stijn dc47c19e55 vendor: github.com/moby/sys/userns v0.2.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-27 17:06:09 +02:00
Sebastiaan van Stijn 3cd22ff935 vendor: github.com/docker/go-metrics v0.1.0
- Add support for creating timers with custom histogram buckets.
- Update `github.com/prometheus/client_golang` to v1.20.5.
- Update the minimum supported Go version to Go 1.21.
- Improve HTTP handler instrumentation, including minor performance improvements and cleanup.
- Avoid mutating shared label maps when creating namespaces and metrics.
- Encapsulate the Prometheus collector used by `HTTPMetric`.
- Improve package and API documentation.
- Update `golang.org/x/sys` and other dependencies.

full diff: https://github.com/docker/go-metrics/compare/v0.0.1...v0.1.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-27 17:05:24 +02:00
Paweł Gronowski 45f589590b Merge pull request #7248 from thaJeztah/bump_runewidth
vendor: github.com/mattn/go-runewidth v0.0.28
2026-08-27 14:10:47 +02:00
Paweł Gronowski 6b8da05715 Merge pull request #7245 from thaJeztah/bump_otels
vendor: go.opentelemetry.io/otel v1.46.0, go.opentelemetry.io/contrib v0.71.0
2026-08-27 14:10:18 +02:00
Paweł Gronowski 65ad909cde Merge pull request #7244 from thaJeztah/bump_logrus
vendor: github.com/sirupsen/logrus v1.10.2
2026-08-27 14:10:06 +02:00
Paweł Gronowski 52eb28a512 Merge pull request #7242 from thaJeztah/bump_platforms
vendor: github.com/containerd/platforms v1.0.0-rc.5
2026-08-27 14:09:02 +02:00
Sebastiaan van Stijn bb63125969 vendor: go.opentelemetry.io/otel v1.46.0, go.opentelemetry.io/contrib v0.71.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-27 01:56:22 +02:00
Sebastiaan van Stijn 2a24c3c77d vendor: google.golang.org/genproto/* da73d73af1c5
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-27 01:56:22 +02:00
Paweł Gronowski 3f096b4ffd Merge pull request #7241 from thaJeztah/bump_protobuf
vendor: google.golang.org/protobuf v1.36.12
2026-08-26 20:18:16 +02:00
Sebastiaan van Stijn ebc3d5aeab Merge pull request #7055 from docker/dependabot/github_actions/codecov/codecov-action-7.0.0
build(deps): bump codecov/codecov-action from 6.0.1 to 7.0.0
2026-08-26 17:16:22 +02:00
Sebastiaan van Stijn 6261c55c56 Merge pull request #7187 from docker/dependabot/github_actions/crazy-max/dot-github/dot-github/workflows/zizmor.yml-1.11.0
build(deps): bump crazy-max/.github/.github/workflows/zizmor.yml from 1.10.1 to 1.11.0
2026-08-26 17:15:31 +02:00
Sebastiaan van Stijn 2c36f84eaf Merge pull request #7225 from docker/dependabot/github_actions/codeql-actions-79dea28a82
build(deps): bump the codeql-actions group across 1 directory with 3 updates
2026-08-26 17:15:00 +02:00
Sebastiaan van Stijn 4f7a1841ba vendor: github.com/mattn/go-runewidth v0.0.28
full diff: https://github.com/mattn/go-runewidth/compare/v0.0.24...v0.0.28

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-26 17:08:29 +02:00
Sebastiaan van Stijn ef48c25aed vendor: github.com/sirupsen/logrus v1.10.2
removes some transitive dependencies

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-26 16:48:02 +02:00
Sebastiaan van Stijn f2514827f4 vendor: github.com/containerd/platforms v1.0.0-rc.5
full diff: https://github.com/containerd/platforms/compare/v1.0.0-rc.4...v1.0.0-rc.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-26 16:41:30 +02:00
Sebastiaan van Stijn f8d6265672 vendor: google.golang.org/protobuf v1.36.12
full diff: https://github.com/protocolbuffers/protobuf-go/compare/v1.36.11...v1.36.12

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-26 16:20:43 +02:00
Paweł Gronowski 744eee4bd4 Merge pull request #7240 from thaJeztah/bump_grpc
vendor: google.golang.org/grpc v1.83.2
2026-08-26 13:06:45 +02:00
Sebastiaan van Stijn d6041d1abc vendor: google.golang.org/grpc v1.83.2
contains a fix for [GHSA-2v4p-qf9q-27wj] and other vulnerabilities
fixed in v1.83.0, v1.83.1

full diff: https://github.com/grpc/grpc-go/compare/v1.82.1...v1.83.2

[GHSA-2v4p-qf9q-27wj]: https://github.com/grpc/grpc-go/security/advisories/GHSA-2v4p-qf9q-27wj

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-26 12:25:17 +02:00
dependabot[bot] 06275f9094 build(deps): bump the codeql-actions group across 1 directory with 3 updates
Bumps the codeql-actions group with 3 updates in the / directory: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action).


Updates `github/codeql-action/init` from 4.37.6 to 4.37.7
- [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/5595ccaf912efad79be6eef63a5619ff05969be3...ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd)

Updates `github/codeql-action/autobuild` from 4.37.6 to 4.37.7
- [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/5595ccaf912efad79be6eef63a5619ff05969be3...ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd)

Updates `github/codeql-action/analyze` from 4.37.6 to 4.37.7
- [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/5595ccaf912efad79be6eef63a5619ff05969be3...ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd)

---
updated-dependencies:
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.37.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
- dependency-name: github/codeql-action/autobuild
  dependency-version: 4.37.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
- dependency-name: github/codeql-action/init
  dependency-version: 4.37.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-26 08:46:02 +00:00
Sebastiaan van Stijn bf6f62cc7c Merge pull request #7195 from thaJeztah/modern_jsonschema
cli/compose/schema: migrate to github.com/santhosh-tekuri/jsonschema/v6
2026-08-25 21:55:32 +02:00
Paweł Gronowski 376f03c858 Merge pull request #7192 from thaJeztah/bump_x_deps
vendor: update golang.org/x/* dependencies
2026-08-25 21:50:33 +02:00
Sebastiaan van Stijn de4a008614 Merge pull request #7233 from docker/dependabot/github_actions/docker-actions-1a2b39a443
build(deps): bump the docker-actions group across 1 directory with 2 updates
2026-08-25 14:54:22 +02:00
dependabot[bot] f3f7da9f3d build(deps): bump the docker-actions group across 1 directory with 2 updates
Bumps the docker-actions group with 2 updates in the / directory: [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) and [docker/docker-agent-action/.github/workflows/review-pr.yml](https://github.com/docker/docker-agent-action).


Updates `docker/setup-buildx-action` from 4.2.0 to 4.3.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/bb05f3f5519dd87d3ba754cc423b652a5edd6d2c...37fe631027851001ddb9b187196cc803df7f5f0e)

Updates `docker/docker-agent-action/.github/workflows/review-pr.yml` from 2.0.3 to 2.0.4
- [Release notes](https://github.com/docker/docker-agent-action/releases)
- [Commits](https://github.com/docker/docker-agent-action/compare/baf90543d81f5de59751dfd10e6cf45e21a5a982...b08367e7e9a471822464be2bb9fdaa1c0fb6061b)

---
updated-dependencies:
- dependency-name: docker/docker-agent-action/.github/workflows/review-pr.yml
  dependency-version: 2.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-actions
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-25 08:43:06 +00:00
Sebastiaan van Stijn eed270f656 cli/compose/schema: migrate to github.com/santhosh-tekuri/jsonschema/v6
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-24 12:53:45 +02:00
Sebastiaan van Stijn d072fe407f Merge pull request #7234 from vvoland/update-dco
docs: Update DCO identity guidance
2026-08-24 12:16:16 +02:00
Paweł Gronowski 3fe73079aa docs: Clarify DCO identity guidance
The DCO policy used here appears to have been derived from the Linux
kernel's guidance. In 2023, that guidance changed to relax the "real
name" requirement to a "known identity".

The DCO sign-off identifies the person certifying that they have the
right to submit a contribution. The previous wording required a "real
name" and rejected pseudonyms, which could discourage contributors
whose preferred or community name is the identity by which they can be
known.

The requirement is not anonymity: the identity in the sign-off must be
known enough for the project to follow up about the contribution if a
question arises. It does not require a legal name or a government-issued
identity. Use the clarified wording from the Linux kernel so known
pseudonyms and preferred names remain acceptable while anonymous
contributions remain excluded.

This also reflects concerns raised in the CNCF community about whether
"real name" means a legal name, a government-issued identity, or a
public identity that is sufficient to identify and contact a
contributor. The discussion emphasized that attribution and future
accountability do not require publishing a legal identity, and that
strict public-name rules can exclude people who cannot safely contribute
under that name.

Source: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d4563201f33a022fc035

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-08-24 11:41:24 +02:00
Kamyar mofakhami a79a16bd63 cli/command/service: preserve mount order on force update
Signed-off-by: Kamyar mofakhami <41609894+kawmy@users.noreply.github.com>
2026-08-21 18:54:45 +03:30
Paweł Gronowski 28f756087e Merge pull request #7224 from vvoland/update-go
update to go1.26.7
2026-08-20 12:38:49 +02:00
Paweł Gronowski 387b8e2af8 update to go1.26.7
This release includes a fix to address a breakage affecting unencrypted
HTTP/2 (h2c) connections caused by a security patch included in last
patch release.

See go.dev/issue/80876 for details.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-08-19 20:23:24 +02:00
Paweł Gronowski f7e66aa1ff gha: Grant PR review permissions required by v2.0.3
`docker-agent-action` v2.0.3 requires callers of its reusable PR
review workflow to grant `actions: write` for review-lock cache
cleanup and feedback artifacts. Earlier releases required only
`actions: read`. See:

https://github.com/docker/docker-agent-action#pr-review-workflow

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-08-19 17:45:14 +02:00
Paweł Gronowski 55e4a7eef5 Merge pull request #7222 from thaJeztah/bump_logrus
vendor: github.com/sirupsen/logrus v1.10.1
2026-08-19 12:34:56 +02:00
Sebastiaan van Stijn 58d9cdd2d9 vendor: github.com/sirupsen/logrus v1.10.1
Notable changes:

- Add bidirectional `log/slog` integration with a Logrus hook and `slog.Handler`.
- Add minimal, composable logging interfaces for individual log levels.
- Fix reentrant logging deadlocks and improve concurrency safety around formatters, hooks, and entries.
- Fix generic `Log`, `Logf`, `Logln`, and `LogFn` methods unexpectedly panicking at `PanicLevel`.
- Allow `Entry.Caller` to be set explicitly and preserved across derived entries.
- Improve `TextFormatter` performance and reduce allocations significantly.
- Improve common Logger and Entry hot paths and caller-reporting performance.
- Update `TextFormatter` handling for `[]byte`, debug/trace colors, and Windows ANSI terminals.
- Raise the minimum supported Go version to Go 1.23.
- Deprecate `Entry.HasCaller` and `MutexWrap`.

release-notes: https://github.com/sirupsen/logrus/releases/tag/v1.10.0
release-notes: https://github.com/sirupsen/logrus/releases/tag/v1.10.1
full diff: https://github.com/sirupsen/logrus/compare/v1.9.4...v1.10.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-19 11:34:53 +02:00
Dean Chen 4f169946e7 docs(history): use the pulled platform in the --platform example
The example pulled linux/riscv64 then ran history for linux/s390x.

Signed-off-by: Dean Chen <862469039@qq.com>
2026-08-18 16:44:38 +05:00
Dean Chen 3c53edb6c5 docs(service create): note global mode still honors constraints
A global service is one task per matching node, not one per
node in the swarm. Say that next to --mode and --constraint.

Signed-off-by: Dean Chen <862469039@qq.com>
2026-08-15 21:36:19 +05:00
Sebastiaan van Stijn 1612f4c767 vendor: golang.org/x/mod v0.40.0
full diff: https://github.com/golang/mod/compare/v0.39.0...v0.40.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-15 14:44:44 +02:00
Sebastiaan van Stijn cf53a284da vendor: golang.org/x/net v0.58.0
full diff: https://github.com/golang/net/compare/v0.57.0...v0.58.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-15 14:43:34 +02:00
Sebastiaan van Stijn 0da5f45651 vendor: golang.org/x/text v0.41.0
full diff: https://github.com/golang/text/compare/v0.40.0...v0.41.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-15 14:42:34 +02:00
Sebastiaan van Stijn ce15202968 vendor: golang.org/x/mod v0.39.0
full diff: https://github.com/golang/mod/compare/v0.38.0...v0.39.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-15 14:41:51 +02:00
Sebastiaan van Stijn 8659aa5d4c Merge pull request #7185 from thaJeztah/duplicate_normalize
cli/command/manifest: remove redundant normalization
2026-08-14 18:42:04 +02:00
Paweł Gronowski 8d08c75e81 Merge pull request #7191 from thaJeztah/bump_go
update to go1.26.6
2026-08-14 14:52:56 +02:00
Sebastiaan van Stijn 24af004cbf update to go1.26.6
This release includes 10 security fixes following the security policy:

- x/mod/sumdb/tlog: fix transparency log tile verification bypass

    A malicious GOPROXY was previously capable of forging
    up to two sumdb tiles that allow for a requested module
    to bypass the GOSUMDB check and persist attacker-controlled
    module content to a local Go module cache.

    This attack allows for a malicious GOPROXY to serve
    malicious module content that cannot be detected
    by evaluating the transparency log.

    All tiles are now correctly verified against their parents.

    In order to determine if you have been affected:

    rm -r go.sum go.work.sum vendor/ && go mod tidy

    Thanks to Filippo Valsorda (Geomys) for reporting this issue.

    This is CVE-2026-56865 and Go issue https://go.dev/issue/80744.

- x/mod/sumdb: ignore unrelated, unauthenticated hashes in Lookup

    A malicious GOSUMDB was capable of serving arbitrary
    module content not contained within the transparency
    log.

    This attack allows for a coordinating GOPROXY and
    GOSUMDB to serve a client malicious module content
    that cannot be detected by evaluating the transparency
    log.

    In order to determine if you have been affected:

    rm -r go.sum go.work.sum vendor/ && go mod tidy

    Thanks to mundur for reporting this issue.

    This is CVE-2026-56864 and Go issue https://go.dev/issue/80745.

- encoding/xml: add recursion depth guard during decode

    Previously, DecodeElement would reset the depth counter
    causing it to never fire; this could lead to stack
    exhaustion.

    This is CVE-2026-56859 and Go issue https://go.dev/issue/80481.

 net/http: apply ReadHeaderTimeout when doing unencrypted HTTP/2 check

    When a server is configured to support unencrypted HTTP/2, it reads a
    few bytes from each new connection to see if they contain the HTTP/2
    client preface. Previously, this was being done with no timeout applied.
    ReadHeaderTimeout is now applied for this.

    This is CVE-2026-56853 and Go issue https://go.dev/issue/80205.

- net/url: avoid quadratic complexity in resolvePath

    Previously, resolving relative paths containing parent directory (..) segments performed string conversions and buffer rewrites on each step, resulting in quadratic time complexity and high memory allocation overhead.

    Now, path resolution operates on a byte buffer using index-based backtracking for .. segments, eliminating the quadratic time complexity and significantly reducing memory allocations.

    This is CVE-2026-56860 and Go issue https://go.dev/issue/80494.

- golang.org/x/net/dns/dnsmessage: panic when parsing invalid SVCB record

    Parsing an invalid SVCB or HTTPS RR can panic when
    the size of a parameter value overflows the message buffer.

    Thanks to Mundur (https://github.com/M0nd0R) for reporting this issue.

    This is CVE-2026-46600 and Go issue https://go.dev/issue/79795.

- crypto/tls: limit handshake messages we are willing to accept post-handshake

    Previously, we always counted handshake messages, such as KeyUpdate, as
    state-advancing, regardless of whether a handshake has been completed or
    not. As a result, a malicious client can keep sending KeyUpdate messages
    to force the server to keep performing key derivation operations
    indefinitely.

    Thanks to Qi Deng of Aurascape.ai for reporting this issue.

    This is CVE-2026-56862 and Go issue https://go.dev/issue/80528.

- html/template: fix Javascript regexp context tracking

    Previously, pathological inputs could close an
    unescaped / early, allowing for attack-controlled
    data to inject arbitrary content, potentially
    leading to XSS.

    Thanks to Ali Sherif for reporting this issue.

    This is CVE-2026-56858 and Go issue https://go.dev/issue/80435.

- x/net/idna: failure to reject ASCII-only Punycode-encoded labels

    The ToASCII and ToUnicode functions incorrectly accepted Punycode-encoded labels
    that decode to an ASCII-only label. For example, ToUnicode("xn--example-.com")
    incorrectly returned the name "example.com" rather than an error.

    The idna package implements the processing algorithm from UTS 46.
    Older versions of UTS 46 included a specification bug which permitted
    multiple ASCII labels to decode to the same Unicode label.
    UTS 46 revision 33 fixed the specification bug.
    The idna package now implements the updated specification.

    This behavior can lead to privilege escalation in programs using the idna package.
    For example, a program which performs privilege checks on the ASCII hostname
    may reject "example.com" but permit "xn--example-.com". If that program subsequently
    converts the ASCII hostname to Unicode, it will inadvertently permits access
    to the Unicode name "example.com".

    Thanks to KC1zs4 (https://github.com/KC1zs4) for reporting this issue.

    This is CVE-2026-39821 and Go issue https://go.dev/issue/78760.

- encoding/asn1: enforce maximum recursion depth

    Enforce a recursion limit in Unmarshal to prevent stack exhaustion
    when parsing deeply-nested, recursive structures.

    Thanks to Marwan Atia (marwans...@gmail.com) for reporting this issue.

    This is CVE-2026-33818 and Go issue https://go.dev/issue/80405.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-14 14:02:40 +02:00
Sebastiaan van Stijn eb68ed19d2 Merge pull request #7157 from docker/dependabot/github_actions/codeql-actions-8417568871
build(deps): bump the codeql-actions group across 1 directory with 3 updates
2026-08-13 22:42:40 +02:00
dependabot[bot] 8a375034e2 build(deps): bump the codeql-actions group across 1 directory with 3 updates
Bumps the codeql-actions group with 3 updates in the / directory: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action).


Updates `github/codeql-action/init` from 4.37.3 to 4.37.6
- [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/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...5595ccaf912efad79be6eef63a5619ff05969be3)

Updates `github/codeql-action/autobuild` from 4.37.3 to 4.37.6
- [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/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...5595ccaf912efad79be6eef63a5619ff05969be3)

Updates `github/codeql-action/analyze` from 4.37.3 to 4.37.6
- [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/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...5595ccaf912efad79be6eef63a5619ff05969be3)

---
updated-dependencies:
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.37.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
- dependency-name: github/codeql-action/autobuild
  dependency-version: 4.37.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
- dependency-name: github/codeql-action/init
  dependency-version: 4.37.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: codeql-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-13 08:46:20 +00:00
dependabot[bot] f755f48a12 build(deps): bump crazy-max/.github/.github/workflows/zizmor.yml
Bumps [crazy-max/.github/.github/workflows/zizmor.yml](https://github.com/crazy-max/.github) from 1.10.1 to 1.11.0.
- [Release notes](https://github.com/crazy-max/.github/releases)
- [Commits](https://github.com/crazy-max/.github/compare/46267a6e61cd56aac2fc79943df180152f4c89d6...f91220cba053bd54299ba645a599ee8ed436f222)

---
updated-dependencies:
- dependency-name: crazy-max/.github/.github/workflows/zizmor.yml
  dependency-version: 1.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-13 08:43:11 +00:00
Sebastiaan van Stijn a7c0741fa7 cli/command/manifest: remove redundant normalization
commit 55fcffe743 added normalization
in config/configfile, so it's no longer needed to normalize here as
well.

updates 55fcffe743

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-12 16:38:26 +02:00
Sebastiaan van Stijn 12892075d2 Merge pull request #7180 from docker/dependabot/github_actions/docker-actions-ebe691cc85
build(deps): bump docker/github-builder/.github/workflows/bake.yml from 1.15.0 to 1.16.0 in the docker-actions group
2026-08-12 15:37:56 +02:00
dependabot[bot] e1f9b284df build(deps): bump docker/github-builder/.github/workflows/bake.yml
Bumps the docker-actions group with 1 update: [docker/github-builder/.github/workflows/bake.yml](https://github.com/docker/github-builder).


Updates `docker/github-builder/.github/workflows/bake.yml` from 1.15.0 to 1.16.0
- [Release notes](https://github.com/docker/github-builder/releases)
- [Commits](https://github.com/docker/github-builder/compare/27ade872c1e2296e62ef15ab3b10d37665e57cf7...a492c6d04fd3315f67230809b44d60cc0acd50b3)

---
updated-dependencies:
- dependency-name: docker/github-builder/.github/workflows/bake.yml
  dependency-version: 1.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-12 08:43:00 +00:00
Paweł Gronowski f4efc1b596 Merge tag 'v29.7.2' into 29.x
v29.7.2
2026-08-11 13:21:01 +02:00
Paweł Gronowski 2747e2e3bf Merge tag 'v29.7.1' into 29.x
v29.7.1
2026-08-11 13:21:01 +02:00
Paweł Gronowski 329cdf1a9d Merge tag 'v29.7.0' into 29.x
v29.7.0
2026-08-11 13:21:01 +02:00
Paweł Gronowski 0c7e2e7203 Merge tag 'v29.7.0-rc.1' into 29.x
v29.7.0-rc.1
2026-08-11 13:21:00 +02:00
Dean Chen 951f7653fc docs: mention build cache in docker system prune description
The synopsis only listed containers, networks, images, and volumes,
but the command always prunes unused build cache (including BuildKit
cache mounts). Align the description with the interactive warning.

Signed-off-by: Dean Chen <862469039@qq.com>
2026-08-10 09:45:49 +05:00
Sebastiaan van Stijn 4f84911bfe Merge pull request #7144 from hirehamir/fix/ps-port-sort
cli/command/formatter: sort published ports numerically by IP
2026-08-06 15:50:28 +02:00
Paweł Gronowski 228f29e810 Merge pull request #7159 from thaJeztah/version_29.8
VERSION: 29.8.0
2026-08-06 15:47:41 +02:00
Sebastiaan van Stijn d8c3543407 VERSION: 29.8.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-06 15:34:41 +02:00
Hamir 2dd7b7e15b cli/command/formatter: sort published ports numerically by IP
`comparePorts` compared host IPs with `i.IP.String() < j.IP.String()`, which
sorts them lexicographically, so "10.0.0.2" ordered before "9.0.0.1" in
`docker ps` output.

This also avoids formatting both addresses as strings on every comparison.

ports    before               after
64       1540 allocs/op       394 allocs/op
256      5364 allocs/op       1548 allocs/op

That's a ~74% (3.9x) reduction in allocations.

Signed-off-by: Hamir <hirehamir@gmail.com>
2026-08-05 11:38:20 -07:00
Paweł Gronowski dfc4efb1e2 Merge pull request #7109 from vvoland/update-docker
[29.x] Bump to 29.6.2
2026-07-16 18:09:24 +02:00
Paweł Gronowski dba867594c Bump to 29.6.2
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-07-16 12:51:30 +02:00
Paweł Gronowski d9aefe565a Merge tag 'v29.6.1' into 29.x
v29.6.1
2026-07-15 17:35:42 +02:00
Paweł Gronowski 9182b351c1 Merge tag 'v29.6.0' into 29.x
v29.6.0
2026-07-15 17:35:42 +02:00
Paweł Gronowski 0ae55a3e6c Merge tag 'v29.5.3' into 29.x
v29.5.3
2026-07-15 17:35:42 +02:00
Paweł Gronowski 029a4b21b3 Merge tag 'v29.5.2' into 29.x
v29.5.2
2026-07-15 17:35:41 +02:00
Paweł Gronowski e596fea454 Merge tag 'v29.5.1' into 29.x
v29.5.1
2026-07-15 17:35:41 +02:00
Paweł Gronowski 0c72f456aa Merge tag 'v29.5.0' into 29.x
v29.5.0
2026-07-15 17:35:41 +02:00
Paweł Gronowski 26f2736a2b Merge tag 'v29.4.1' into 29.x
v29.4.1
2026-07-15 17:35:41 +02:00
Paweł Gronowski ac4c4dfabd Merge tag 'v29.4.0' into 29.x
v29.4.0
2026-07-15 17:35:40 +02:00
Sebastiaan van Stijn 1245054535 Merge pull request #7099 from vvoland/7098-29.x
[29.x backport] scripts/sync-branch: Fix non-interactive merge
2026-07-10 08:34:26 +02:00
Paweł Gronowski f72fb0caf0 scripts/sync-branch: Fix non-interactive merge
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit f57e528457)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-07-09 16:52:02 +02:00
Sebastiaan van Stijn e4af2bf0d3 Merge pull request #7097 from vvoland/7091-29.x
[29.x backport] gha: Add release branch sync workflow
2026-07-09 16:35:45 +02:00
Paweł Gronowski 49a1af6aaa gha: Add release branch sync workflow
Add a manually dispatched workflow for maintainers to sync a Docker
release branch to a selected release tag.

The sync-release-branch job checks out the release branch, computes
the list of unmerged tags up to the requested tag via
scripts/unmerged-tags, merges them in order via scripts/sync-branch
using git merge --no-ff (resolving conflicts by taking the tag's
content), then pushes the result to a temporary branch.

The push-release-branch job runs after manual approval via the
docker-releases environment. It verifies that neither the release
branch nor the temporary branch moved since the sync job ran before
force-advancing the release branch and deleting the temporary branch.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 182f56fe8c)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-07-09 14:45:32 +02:00
dependabot[bot] 244404379d build(deps): bump codecov/codecov-action from 6.0.1 to 7.0.0
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 6.0.1 to 7.0.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/e79a6962e0d4c0c17b229090214935d2e33f8354...fb8b3582c8e4def4969c97caa2f19720cb33a72f)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-15 08:44:21 +00:00
Paweł Gronowski c2be9ccfc3 Merge pull request #6887 from thaJeztah/29.x_backport_pin_actions
[29.x backport] ci: pin actions to digests
2026-03-25 15:22:32 +01:00
Sebastiaan van Stijn 0da6a5121f ci: pin actions to digests
As a follow-up, we should use the full version (major.minor.patch).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 97b9e04a94)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-25 15:06:23 +01:00
Sebastiaan van Stijn 6b3ca8fc04 Merge pull request #6884 from thaJeztah/29.x_backport_missing_buildtags
[29.x backport] cli/command: add missing "go:build" comments
2026-03-25 15:04:52 +01:00
Paweł Gronowski f47603c290 Merge pull request #6885 from thaJeztah/29.x_backport_update_actions
[29.x backport] update actions
2026-03-25 14:23:37 +01:00
dependabot[bot] 9709c8fe08 build(deps): bump docker/metadata-action from 5 to 6
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5 to 6.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](https://github.com/docker/metadata-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 39d676c72d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-25 14:16:00 +01:00
dependabot[bot] af45a23fa9 build(deps): bump docker/bake-action from 6 to 7
Bumps [docker/bake-action](https://github.com/docker/bake-action) from 6 to 7.
- [Release notes](https://github.com/docker/bake-action/releases)
- [Commits](https://github.com/docker/bake-action/compare/v6...v7)

---
updated-dependencies:
- dependency-name: docker/bake-action
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 6453c4c3a7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-25 14:15:48 +01:00
Paweł Gronowski bc97f5ac19 Merge pull request #6883 from thaJeztah/29.x_backport_update_go1.25.8
[29.x backport] update to go1.25.8
2026-03-25 14:14:46 +01:00
Sebastiaan van Stijn 6d71967120 cli/command: add missing "go:build" comments
- commit e8dc2fce32 modernized loops to
  range over int, which requires go1.22 or later.
- commit 85ebca52fd modernized code to
  use stdlib min/max, which requires go1.21 or later.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9a471180cb)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-25 14:11:15 +01:00
Sebastiaan van Stijn 9b51892b80 update to go1.25.8
go1.25.8 (released 2026-03-05) includes security fixes to the html/template,
net/url, and os packages, as well as bug fixes to the go command, the compiler,
and the os package. See the Go 1.25.8 milestone on our issue tracker for details.

- 1.25.8 https://github.com/golang/go/issues?q=milestone%3AGo1.25.8+label%3ACherryPickApproved
- diff: https://github.com/golang/go/compare/go1.25.7...go1.25.8
- 1.26.1 https://github.com/golang/go/issues?q=milestone%3AGo1.26.1+label%3ACherryPickApproved
- diff: https://github.com/golang/go/compare/go1.26.0...go1.26.1

---

We have just released Go versions 1.26.1 and 1.25.8, minor point releases.

These releases include 5 security fixes following the security policy:

crypto/x509: incorrect enforcement of email constraints

- When verifying a certificate chain which contains a certificate containing
  multiple email address constraints (composed of the full email address) which
  share common local portions (the portion of the address before the '@'
  character) but different domain portions (the portion of the address after the
  '@' character), these constraints will not be properly applied, and only the
  last constraint will be considered.

  This can allow certificates in the chain containing email addresses which are
  either not permitted or excluded by the relevant constraints to be returned by
  calls to Certificate.Verify. Since the name constraint checks happen after chain
  building is complete, this only applies to certificate chains which chain to
  trusted roots (root certificates either in VerifyOptions.Roots or in the system
  root certificate pool), requiring a trusted CA to issue certificates containing
  either not permitted or excluded email addresses.

  This issue only affects Go 1.26.

  Thanks to Jakub Ciolek for reporting this issue.

  This is CVE-2026-27137 and Go issue https://go.dev/issue/77952.

- crypto/x509: panic in name constraint checking for malformed certificates

  Certificate verification can panic when a certificate in the chain has an empty
  DNS name and another certificate in the chain has excluded name constraints.
  This can crash programs that are either directly verifying X.509 certificate
  chains, or those that use TLS.

  Since the name constraint checks happen after chain building is complete, this
  only applies to certificate chains which chain to trusted roots (root
  certificates either in VerifyOptions.Roots or in the system root certificate
  pool), requiring a trusted CA to issue certificates containing malformed DNS
  names.

  This issue only affects Go 1.26.

  Thanks to Jakub Ciolek for reporting this issue.

  This is CVE-2026-27138 and Go issue https://go.dev/issue/77953.

- html/template: URLs in meta content attribute actions are not escaped

  Actions which insert URLs into the content attribute of HTML meta tags are not
  escaped. This can allow XSS if the meta tag also has an http-equiv attribute
  with the value "refresh".

  A new GODEBUG setting has been added, htmlmetacontenturlescape, which can be
  used to disable escaping URLs in actions in the meta content attribute which
  follow "url=" by setting htmlmetacontenturlescape=0.

  This is CVE-2026-27142 and Go issue https://go.dev/issue/77954.

- net/url: reject IPv6 literal not at start of host

  The Go standard library function net/url.Parse insufficiently
  validated the host/authority component and accepted some invalid URLs
  by effectively treating garbage before an IP-literal as ignorable.
  The function should have rejected this as invalid.

  To prevent this behavior, net/url.Parse now rejects IPv6 literals
  that do not appear at the start of the host subcomponent of a URL.

  Thanks to Masaki Hara (https://github.com/qnighy) of Wantedly.

  This is CVE-2026-25679 and Go issue https://go.dev/issue/77578.

- os: FileInfo can escape from a Root

  On Unix platforms, when listing the contents of a directory using
  File.ReadDir or File.Readdir the returned FileInfo could reference
  a file outside of the Root in which the File was opened.

  The contents of the FileInfo were populated using the lstat system
  call, which takes the path to the file as a parameter. If a component
  of the full path of the file described by the FileInfo is replaced with
  a symbolic link, the target of the lstat can be directed to another
  location on the filesystem.

  The impact of this escape is limited to reading metadata provided by
  lstat from arbitrary locations on the filesystem. This could be used
  to probe for the presence or absence of files as well as gleaning
  metadata like file sizes, but does not permit reading or writing files
  outside the root.

  The FileInfo is now populated using fstatat.

  Thank you to Miloslav Trmač of Red Hat for reporting this issue.

  This is CVE-2026-27139 and Go issue https://go.dev/issue/77827.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f7d83cbae8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-03-25 14:08:46 +01:00
948 changed files with 68874 additions and 20615 deletions
+20 -17
View File
@@ -1,34 +1,37 @@
<!--
Make sure you've read and understood our contributing guidelines;
Please make sure you've read and understood our contributing guidelines;
https://github.com/docker/cli/blob/master/CONTRIBUTING.md
** Make sure all your commits include a signature generated with `git commit -s` **
Make sure commits are signed off (`git commit -s`) with your real name.
If this is a bug fix, make sure your description includes "fixes #xxxx", or
"closes #xxxx"
If the PR relates to an existing issue or PR, mention it at the top:
Provide the following information:
- Fixes: https://github.com/docker/cli/issues/12345678
- Replaces: https://github.com/docker/cli/pull/12345678
- Follow up to: https://github.com/docker/cli/pull/12345678
- Related to: https://github.com/docker/cli/issues/12345678
-->
**- What I did**
## Summary
**- How I did it**
**- How to verify it**
**- Human readable description for the release notes**
## Release notes (optional)
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog.
It must be placed inside the below triple backticks section.
One-sentence user-facing release note.
Leave empty if the change is not changelog-worthy.
Use present tense and imperative tone.
NOTE: Only fill this section if changes introduced in this PR are user-facing.
The PR must have a relevant impact/ label.
Good:
- Fix a panic when running `docker top` on a non-running Windows container.
- Don't print warnings in `docker info` for broken symlinks in CLI plugin directories.
Bad:
- Refactor test TestFooWithBar
- Fixed a panic when running docker top
-->
```markdown changelog
```
**- A picture of a cute animal (not mandatory but encouraged)**
## A picture of a cute animal (not mandatory but encouraged)
+59
View File
@@ -0,0 +1,59 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
// https://docs.renovatebot.com/modules/manager/github-actions/
// https://docs.renovatebot.com/presets-helpers/
"helpers:pinGitHubActionDigestsToSemver",
":gitSignOff"
],
"gomod": {
"managerFilePatterns": ["/(^|/)vendor\\.mod$/"]
},
"postUpdateOptions": ["gomodTidy"],
"minimumReleaseAge": "3 days",
"internalChecksFilter": "strict",
"packageRules": [
{
"matchManagers": ["gomod"],
"matchFileNames": ["vendor.mod"],
"semanticCommits": "disabled",
"commitMessagePrefix": "vendor:"
},
{
"matchManagers": ["gomod"],
"matchFileNames": ["cmd/docker-trust/go.mod"],
// The trust module does not vendor dependencies; vendor/ belongs to the root module.
"postUpdateOptions": ["gomodSkipVendor"],
"semanticCommits": "disabled",
"commitMessagePrefix": "cmd/docker-trust:"
},
{
"matchManagers": ["gomod"],
"matchFileNames": ["vendor.mod"],
"groupName": "golang.org/x packages",
"groupSlug": "golang-x",
"matchDepNames": ["/^golang\\.org\\/x\\//"]
},
{
"matchManagers": ["github-actions"],
"minimumReleaseAge": "7 days",
"addLabels": ["area/ci", "status/2-code-review"]
},
{
"matchManagers": ["github-actions"],
"groupName": "docker GitHub Actions",
"groupSlug": "docker-actions",
"matchDepNames": ["/^docker\\//"]
},
{
// Keep all the google.golang.org/genproto modules at the same version.
"matchManagers": ["gomod"],
"matchFileNames": ["vendor.mod"],
"groupName": "google.golang.org/genproto packages",
"groupSlug": "google-genproto",
"matchDepNames": ["/^google\\.golang\\.org\\/genproto(\\/|$)/"],
"schedule": ["every month"]
}
]
}
+10 -10
View File
@@ -29,7 +29,7 @@ on:
jobs:
prepare:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
outputs:
matrix: ${{ steps.platforms.outputs.matrix }}
steps:
@@ -49,7 +49,7 @@ jobs:
echo ${{ steps.platforms.outputs.matrix }}
build:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
needs:
- prepare
strategy:
@@ -65,10 +65,10 @@ jobs:
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
-
name: Build
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
uses: docker/bake-action@018cb6412ab401ebaa809aa5f85966b74628600f # v7.4.0
with:
targets: ${{ matrix.target }}
set: |
@@ -91,7 +91,7 @@ jobs:
PLATFORM: ${{ matrix.platform }}
-
name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ env.ARTIFACT_NAME }}
path: /tmp/out/*
@@ -99,7 +99,7 @@ jobs:
bin-image:
if: ${{ github.event_name != 'pull_request' && github.repository == 'docker/cli' }}
uses: docker/github-builder/.github/workflows/bake.yml@27ade872c1e2296e62ef15ab3b10d37665e57cf7 # v1.15.0
uses: docker/github-builder/.github/workflows/bake.yml@58cb9f5b71b1836d6f690c1e95effdeb9b98cb8a # v1.17.0
permissions:
contents: read # same as global permission
id-token: write # for signing attestation(s) and authenticating to Docker Hub with GitHub OIDC Token
@@ -126,7 +126,7 @@ jobs:
connection_id: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }}
prepare-plugins:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
outputs:
matrix: ${{ steps.platforms.outputs.matrix }}
steps:
@@ -146,7 +146,7 @@ jobs:
echo ${{ steps.platforms.outputs.matrix }}
plugins:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
needs:
- prepare-plugins
strategy:
@@ -156,10 +156,10 @@ jobs:
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
-
name: Build
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
uses: docker/bake-action@018cb6412ab401ebaa809aa5f85966b74628600f # v7.4.0
with:
targets: plugins-cross
set: |
+5 -5
View File
@@ -34,7 +34,7 @@ on:
jobs:
codeql:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
timeout-minutes: 10
env:
DISABLE_WARN_OUTSIDE_CONTAINER: '1'
@@ -64,18 +64,18 @@ jobs:
name: Update Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: "1.26.5"
go-version: "1.26.10"
cache: false
-
name: Initialize CodeQL
uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
with:
languages: go
-
name: Autobuild
uses: github/codeql-action/autobuild@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
uses: github/codeql-action/autobuild@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
-
name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
with:
category: "/language:go"
+5 -4
View File
@@ -26,7 +26,7 @@ on:
jobs:
tests:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
strategy:
fail-fast: false
matrix:
@@ -37,6 +37,7 @@ jobs:
- alpine
- debian
engine-version:
- master # moby/moby-bin:master
- rc # latest rc
- 29 # latest
- 28 # latest - 1
@@ -51,7 +52,7 @@ jobs:
name: Update daemon.json
run: |
if [ ! -f /etc/docker/daemon.json ]; then
# ubuntu 24.04 runners no longer have a default daemon.json present
# ubuntu runners no longer have a default daemon.json present
sudo mkdir -p /etc/docker/
echo '{"experimental": true}' | sudo tee /etc/docker/daemon.json
else
@@ -65,7 +66,7 @@ jobs:
docker info
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
-
name: Run ${{ matrix.target }}
run: |
@@ -76,7 +77,7 @@ jobs:
TESTFLAGS: -coverprofile=/tmp/coverage/coverage.txt
-
name: Send to Codecov
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
files: ./build/coverage/coverage.txt
token: ${{ secrets.CODECOV_TOKEN }}
+1 -1
View File
@@ -35,7 +35,7 @@ jobs:
fi
- name: Upload context
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: pr-review-context
path: context/
+2 -2
View File
@@ -11,13 +11,13 @@ permissions:
jobs:
review:
uses: docker/docker-agent-action/.github/workflows/review-pr.yml@baf90543d81f5de59751dfd10e6cf45e21a5a982 # v2.0.3
uses: docker/docker-agent-action/.github/workflows/review-pr.yml@3654ec391b070e247de2e2e3c1ff2519b6378b3a # v2.0.9
permissions:
contents: read # Read repository files and PR diffs
pull-requests: write # Post review comments
issues: write # Create security incident issues if secrets detected
checks: write # (Optional) Show review progress as a check run
id-token: write # Required for OIDC authentication to AWS Secrets Manager
actions: read # Download artifacts from trigger workflow
actions: write # Required since v2.0.3 — review-lock cache cleanup and feedback artifacts
with:
trigger-run-id: ${{ github.event_name == 'workflow_run' && format('{0}', github.event.workflow_run.id) || '' }}
+2 -2
View File
@@ -26,7 +26,7 @@ on:
jobs:
sync-release-branch:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
permissions:
contents: write
actions: write
@@ -116,7 +116,7 @@ jobs:
push-release-branch:
needs: sync-release-branch
if: ${{ !inputs.dry_run && needs.sync-release-branch.outputs.has_changes == 'true' }}
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
environment: docker-releases
permissions:
contents: write
+6 -6
View File
@@ -26,19 +26,19 @@ on:
jobs:
ctn:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
-
name: Test
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
uses: docker/bake-action@018cb6412ab401ebaa809aa5f85966b74628600f # v7.4.0
with:
targets: test-coverage
-
name: Send to Codecov
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
files: ./build/coverage/coverage.txt
token: ${{ secrets.CODECOV_TOKEN }}
@@ -68,7 +68,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: "1.26.5"
go-version: "1.26.10"
cache: false
-
name: Test
@@ -82,7 +82,7 @@ jobs:
shell: bash
-
name: Send to Codecov
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
files: /tmp/coverage.txt
working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli
+1 -1
View File
@@ -10,7 +10,7 @@ on:
jobs:
validate-milestone:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
timeout-minutes: 5
steps:
- name: Validate milestone matches VERSION
+3 -3
View File
@@ -15,7 +15,7 @@ on:
jobs:
check-labels:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
timeout-minutes: 120 # guardrails timeout for the whole job
steps:
- name: Missing `area/` label
@@ -32,7 +32,7 @@ jobs:
run: exit 0
check-changelog:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
timeout-minutes: 120 # guardrails timeout for the whole job
env:
HAS_IMPACT_LABEL: ${{ contains(join(github.event.pull_request.labels.*.name, ','), 'impact/') }}
@@ -70,7 +70,7 @@ jobs:
echo "$desc"
check-pr-branch:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
timeout-minutes: 120 # guardrails timeout for the whole job
env:
PR_TITLE: ${{ github.event.pull_request.title }}
+6 -6
View File
@@ -26,7 +26,7 @@ on:
jobs:
validate:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
strategy:
fail-fast: false
matrix:
@@ -38,13 +38,13 @@ jobs:
steps:
-
name: Run
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
uses: docker/bake-action@018cb6412ab401ebaa809aa5f85966b74628600f # v7.4.0
with:
targets: ${{ matrix.target }}
# check that the generated Markdown and the checked-in files match
validate-md:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
steps:
-
name: Checkout
@@ -66,7 +66,7 @@ jobs:
fi
validate-make:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
strategy:
fail-fast: false
matrix:
@@ -86,7 +86,7 @@ jobs:
make -f docker.Makefile ${{ matrix.target }}
validate-gocompat:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
env:
GOPATH: ${{ github.workspace }}
GO111MODULE: off
@@ -101,7 +101,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: "1.26.5"
go-version: "1.26.10"
cache: false
-
name: Run gocompat check
+1 -1
View File
@@ -21,7 +21,7 @@ on:
jobs:
run:
uses: crazy-max/.github/.github/workflows/zizmor.yml@46267a6e61cd56aac2fc79943df180152f4c89d6 # v1.10.1
uses: crazy-max/.github/.github/workflows/zizmor.yml@f91220cba053bd54299ba645a599ee8ed436f222 # v1.11.0
permissions:
contents: read
security-events: write
+1 -1
View File
@@ -5,7 +5,7 @@ run:
# which causes it to fallback to go1.17 semantics.
#
# TODO(thaJeztah): update "usetesting" settings to enable go1.24 features once our minimum version is go1.24
go: "1.26.5"
go: "1.26.10"
timeout: 5m
+1 -1
View File
@@ -267,7 +267,7 @@ Then you just add a line to every git commit message:
Signed-off-by: Joe Smith <joe.smith@email.com>
Use your real name (sorry, no pseudonyms or anonymous contributions.)
Use a known identity (sorry, no anonymous contributions.)
If you set your `user.name` and `user.email` git configs, you can sign your
commit automatically with `git commit -s`.
+4 -4
View File
@@ -8,11 +8,11 @@ ARG BASE_VARIANT=alpine
ARG ALPINE_VERSION=3.23
ARG BASE_DEBIAN_DISTRO=bookworm
ARG GO_VERSION=1.26.5
ARG GO_VERSION=1.26.10
# XX_VERSION specifies the version of the xx utility to use.
# It must be a valid tag in the docker.io/tonistiigi/xx image repository.
ARG XX_VERSION=1.9.0
ARG XX_VERSION=1.10.0
# GOVERSIONINFO_VERSION is the version of GoVersionInfo to install.
# It must be a valid tag from https://github.com/josephspurrier/goversioninfo
@@ -25,12 +25,12 @@ ARG GOTESTSUM_VERSION=v1.13.0
# BUILDX_VERSION sets the version of buildx to use for the e2e tests.
# It must be a tag in the docker.io/docker/buildx-bin image repository
# on Docker Hub.
ARG BUILDX_VERSION=0.34.1
ARG BUILDX_VERSION=0.38.0
# COMPOSE_VERSION is the version of compose to install in the dev container.
# It must be a tag in the docker.io/docker/compose-bin image repository
# on Docker Hub.
ARG COMPOSE_VERSION=v5.1.3
ARG COMPOSE_VERSION=v5.6.0
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
+1 -1
View File
@@ -1 +1 @@
29.7.2
29.9.2
+5 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
// Package hooks defines the contract between the Docker CLI and CLI plugin hook
// implementations.
@@ -30,7 +30,11 @@ package hooks
type ResponseType int
const (
// NextSteps renders suggestions under a shared "What's next:" header.
NextSteps ResponseType = 0
// GenericMessage renders before NextSteps, without a header or indentation.
// CLI versions that do not recognize this type ignore the response.
GenericMessage ResponseType = 1
)
// Request is the type representing the information
+35 -10
View File
@@ -7,17 +7,42 @@ const (
indent = " "
)
// PrintNextSteps renders list of [NextSteps] messages and writes them
// to out. It is a no-op if messages is empty.
func PrintNextSteps(out io.Writer, messages []string) {
if len(messages) == 0 {
return
// PrintMessages groups messages by type and writes them to out. Generic messages
// appear first, without a header or indentation, followed by next steps under a
// shared "What's next:" header. Order within each type is preserved.
// Messages with no lines or an unknown type produce no output.
func PrintMessages(out io.Writer, messages []Response, evaluate func(Response) []string) {
grouped := make(map[ResponseType][]string)
for _, message := range messages {
lines := evaluate(message)
grouped[message.Type] = append(grouped[message.Type], lines...)
}
for _, responseType := range []ResponseType{GenericMessage, NextSteps} {
lines := grouped[responseType]
if len(lines) == 0 {
continue
}
_, _ = io.WriteString(out, whatsNext)
for _, msg := range messages {
_, _ = io.WriteString(out, indent)
_, _ = io.WriteString(out, msg)
_, _ = io.WriteString(out, "\n")
header, prefix := "\n", ""
if responseType == NextSteps {
header, prefix = whatsNext, indent
}
_, _ = io.WriteString(out, header)
for _, line := range lines {
_, _ = io.WriteString(out, prefix)
_, _ = io.WriteString(out, line)
_, _ = io.WriteString(out, "\n")
}
}
}
// PrintNextSteps renders list of [NextSteps] messages and writes them
// to out. It is a no-op if messages is empty.
//
// Deprecated: use [PrintMessages] instead.
func PrintNextSteps(out io.Writer, messages []string) {
PrintMessages(out, []Response{{Type: NextSteps}}, func(Response) []string {
return messages
})
}
+84 -1
View File
@@ -8,7 +8,85 @@ import (
"gotest.tools/v3/assert"
)
func TestPrintHookMessages(t *testing.T) {
func TestPrintMessages(t *testing.T) {
const header = "\n\x1b[1mWhat's next:\x1b[0m\n"
for _, tc := range []struct {
doc string
messages []hooks.Response
expected string
}{
{doc: "no messages"},
{
doc: "no lines",
messages: []hooks.Response{
{Type: hooks.GenericMessage},
{Type: hooks.NextSteps},
},
},
{
doc: "generic message",
messages: []hooks.Response{
{Type: hooks.GenericMessage, Template: "Session active"},
},
expected: "\nSession active\n",
},
{
doc: "preserve message formatting",
messages: []hooks.Response{
{Type: hooks.GenericMessage, Template: "Session active\n\n Details"},
},
expected: "\nSession active\n\n Details\n",
},
{
doc: "next steps",
messages: []hooks.Response{
{Type: hooks.NextSteps, Template: "Try another command"},
},
expected: header + " Try another command\n",
},
{
doc: "group interleaved types and preserve order within each type",
messages: []hooks.Response{
{Type: hooks.NextSteps, Template: "First suggestion"},
{Type: hooks.GenericMessage, Template: "Session active"},
{Type: hooks.NextSteps, Template: "Second suggestion\nThird suggestion"},
{Type: hooks.GenericMessage, Template: "Another status"},
},
expected: "\nSession active\nAnother status\n" + header + " First suggestion\n Second suggestion\n Third suggestion\n",
},
{
doc: "unknown type",
messages: []hooks.Response{
{Type: hooks.ResponseType(99), Template: "Ignored"},
},
},
{
doc: "unknown type does not affect known messages",
messages: []hooks.Response{
{Type: hooks.ResponseType(99), Template: "Ignored"},
{Type: hooks.GenericMessage, Template: "Session active"},
{Type: hooks.NextSteps, Template: "Try another command"},
},
expected: "\nSession active\n" + header + " Try another command\n",
},
} {
t.Run(tc.doc, func(t *testing.T) {
var w strings.Builder
hooks.PrintMessages(&w, tc.messages, func(message hooks.Response) []string {
if message.Template == "" {
return nil
}
lines, err := hooks.ParseTemplate(message.Template, nil)
assert.NilError(t, err)
return lines
})
assert.Equal(t, w.String(), tc.expected)
})
}
}
func TestPrintNextSteps(t *testing.T) {
const header = "\n\x1b[1mWhat's next:\x1b[0m\n"
tests := []struct {
@@ -34,6 +112,11 @@ func TestPrintHookMessages(t *testing.T) {
" Foo\n" +
" bar\n",
},
{
doc: "preserve empty and indented lines",
messages: []string{"", " Details", ""},
expectedOutput: header + " \n Details\n \n",
},
}
for _, tc := range tests {
t.Run(tc.doc, func(t *testing.T) {
+12 -2
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package hooks
@@ -7,6 +7,7 @@ import (
"bytes"
"errors"
"fmt"
"slices"
"strings"
"text/template"
@@ -43,7 +44,16 @@ func ParseTemplate(hookTemplate string, cmd *cobra.Command) ([]string, error) {
if n := strings.Count(out, "\n"); n > maxMessages {
return nil, fmt.Errorf("hook template contains too many messages (%d): maximum is %d", n, maxMessages)
}
return strings.SplitN(out, "\n", maxMessages), nil
lines := strings.SplitN(out, "\n", maxMessages)
// Skip messages containing only whitespace, but preserve empty lines
// in messages that have content (e.g., for paragraph spacing).
if !slices.ContainsFunc(lines, func(line string) bool {
return strings.TrimSpace(line) != ""
}) {
return nil, nil
}
return lines, nil
}
var ErrHookTemplateParse = errors.New("failed to parse hook template")
+11 -1
View File
@@ -33,7 +33,17 @@ func TestParseTemplate(t *testing.T) {
{
doc: "empty template",
template: "",
expectedOutput: []string{""},
expectedOutput: nil,
},
{
doc: "only empty lines",
template: "\n\n",
expectedOutput: nil,
},
{
doc: "whitespace-only lines",
template: " \n\t\n ",
expectedOutput: nil,
},
{
doc: "plain message",
+2 -1
View File
@@ -3,6 +3,7 @@ package manager
import (
"os"
"path/filepath"
"slices"
"sync"
"testing"
@@ -45,7 +46,7 @@ func TestPluginStubCompletionRestoresOSArgs(t *testing.T) {
t.Cleanup(func() { os.Args = savedArgs })
originalArgs := []string{"docker", "image", "ls"}
os.Args = append([]string(nil), originalArgs...)
os.Args = slices.Clone(originalArgs)
_, directive := cmd.ValidArgsFunction(cmd, []string{"--all"}, "alp")
assert.Equal(t, directive, cobra.ShellCompDirectiveError)
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package manager
+24 -48
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package manager
@@ -49,11 +49,18 @@ func RunPluginHooks(ctx context.Context, dockerCLI config.Provider, rootCmd, sub
}
func runHooks(ctx context.Context, cfg *configfile.ConfigFile, rootCmd, subCommand *cobra.Command, invokedCommand string, flags map[string]string, cmdErrorMessage string) {
nextSteps := invokeAndCollectHooks(ctx, cfg, rootCmd, subCommand, invokedCommand, flags, cmdErrorMessage)
hooks.PrintNextSteps(subCommand.ErrOrStderr(), nextSteps)
messages := invokeAndCollectHooks(ctx, cfg, rootCmd, invokedCommand, flags, cmdErrorMessage)
hooks.PrintMessages(subCommand.ErrOrStderr(), messages, func(message hooks.Response) []string {
lines, err := hooks.ParseTemplate(message.Template, subCommand)
if err != nil {
logrus.WithError(err).Debug("Failed to evaluate hook template")
return nil
}
return lines
})
}
func invokeAndCollectHooks(ctx context.Context, cfg *configfile.ConfigFile, rootCmd, subCmd *cobra.Command, subCmdStr string, flags map[string]string, cmdErrorMessage string) []string {
func invokeAndCollectHooks(ctx context.Context, cfg *configfile.ConfigFile, rootCmd *cobra.Command, subCmdStr string, flags map[string]string, cmdErrorMessage string) []hooks.Response {
if ctx.Err() != nil {
return nil
}
@@ -64,17 +71,17 @@ func invokeAndCollectHooks(ctx context.Context, cfg *configfile.ConfigFile, root
}
pluginDirs := getPluginDirs(cfg)
nextSteps := make([]string, 0, len(pluginsCfg))
var collected []hooks.Response
tryInvokeHook := func(pluginName string, pluginCfg map[string]string) (messages []string, ok bool, err error) {
tryInvokeHook := func(pluginName string, pluginCfg map[string]string) (hooks.Response, error) {
match, matched := pluginMatch(pluginCfg, subCmdStr, cmdErrorMessage)
if !matched {
return nil, false, nil
return hooks.Response{}, nil
}
p, err := getPlugin(pluginName, pluginDirs, rootCmd)
if err != nil {
return nil, false, err
return hooks.Response{}, err
}
resp, err := p.RunHook(ctx, hooks.Request{
@@ -83,29 +90,23 @@ func invokeAndCollectHooks(ctx context.Context, cfg *configfile.ConfigFile, root
CommandError: cmdErrorMessage,
})
if err != nil {
return nil, false, err
return hooks.Response{}, err
}
var message hooks.Response
if err := json.Unmarshal(resp, &message); err != nil {
return nil, false, fmt.Errorf("failed to unmarshal hook response (%q): %w", string(resp), err)
return hooks.Response{}, fmt.Errorf("failed to unmarshal hook response (%q): %w", string(resp), err)
}
// currently the only hook type
if message.Type != hooks.NextSteps {
return nil, false, errors.New("unexpected hook response type: " + strconv.Itoa(int(message.Type)))
if message.Type != hooks.NextSteps && message.Type != hooks.GenericMessage {
return hooks.Response{}, errors.New("unexpected hook response type: " + strconv.Itoa(int(message.Type)))
}
messages, err = hooks.ParseTemplate(message.Template, subCmd)
if err != nil {
return nil, false, err
}
return messages, true, nil
return message, nil
}
for pluginName, pluginCfg := range pluginsCfg {
messages, ok, err := tryInvokeHook(pluginName, pluginCfg)
message, err := tryInvokeHook(pluginName, pluginCfg)
if err != nil {
// skip misbehaving plugins, but don't halt execution
logrus.WithFields(logrus.Fields{
@@ -114,38 +115,13 @@ func invokeAndCollectHooks(ctx context.Context, cfg *configfile.ConfigFile, root
}).Debug("Plugin hook invocation failed")
continue
}
if !ok {
if message.Template == "" {
continue
}
var appended bool
nextSteps, appended = appendNextSteps(nextSteps, messages)
if !appended {
logrus.WithFields(logrus.Fields{
"plugin": pluginName,
}).Debug("Plugin responded with an empty hook message; ignoring")
}
collected = append(collected, message)
}
return nextSteps
}
// appendNextSteps appends the processed hook output to the nextSteps slice.
// If the processed hook output is empty, it is not appended.
// Empty lines are not stripped if there's at least one non-empty line.
func appendNextSteps(nextSteps []string, processed []string) ([]string, bool) {
empty := true
for _, l := range processed {
if strings.TrimSpace(l) != "" {
empty = false
break
}
}
if empty {
return nextSteps, false
}
return append(nextSteps, processed...), true
return collected
}
// pluginMatch takes a plugin configuration and a string representing the
+108 -35
View File
@@ -2,6 +2,11 @@ package manager
import (
"context"
"fmt"
"os"
"path/filepath"
"runtime"
"strings"
"testing"
"github.com/docker/cli/cli/config/configfile"
@@ -258,38 +263,6 @@ func TestMatchHookConfig(t *testing.T) {
}
}
func TestAppendNextSteps(t *testing.T) {
testCases := []struct {
processed []string
expectedOut []string
}{
{
processed: []string{},
expectedOut: []string{},
},
{
processed: []string{"", ""},
expectedOut: []string{},
},
{
processed: []string{"Some hint", "", "Some other hint"},
expectedOut: []string{"Some hint", "", "Some other hint"},
},
{
processed: []string{"Hint 1", "Hint 2"},
expectedOut: []string{"Hint 1", "Hint 2"},
},
}
for _, tc := range testCases {
t.Run("", func(t *testing.T) {
got, appended := appendNextSteps([]string{}, tc.processed)
assert.Check(t, is.DeepEqual(got, tc.expectedOut))
assert.Check(t, is.Equal(appended, len(got) > 0))
})
}
}
func TestRunPluginHooksPassesErrorMessage(t *testing.T) {
cfg := configfile.New("")
cfg.Plugins = map[string]map[string]string{
@@ -336,7 +309,7 @@ func TestInvokeAndCollectHooksErrorHooksSkippedOnSuccess(t *testing.T) {
// On success, error-hooks should not match, so the plugin
// binary is never looked up and no results are returned.
result := invokeAndCollectHooks(
context.Background(), cfg, root, sub,
context.Background(), cfg, root,
"build", map[string]string{}, "",
)
assert.Check(t, is.Len(result, 0))
@@ -349,7 +322,7 @@ func TestInvokeAndCollectHooksNoPlugins(t *testing.T) {
root.AddCommand(sub)
result := invokeAndCollectHooks(
context.Background(), cfg, root, sub,
context.Background(), cfg, root,
"build", map[string]string{}, "some error",
)
assert.Check(t, is.Len(result, 0))
@@ -368,8 +341,108 @@ func TestInvokeAndCollectHooksCancelledContext(t *testing.T) {
cancel() // cancel immediately
result := invokeAndCollectHooks(
ctx, cfg, root, sub,
ctx, cfg, root,
"build", map[string]string{}, "exit status 1",
)
assert.Check(t, is.Nil(result))
}
func TestRunHooksMessages(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("test plugins require a POSIX shell")
}
const header = "\n\x1b[1mWhat's next:\x1b[0m\n"
for _, tc := range []struct {
doc string
responses map[string]string
expected string
}{
{
doc: "generic message preserves formatting and expands templates",
responses: map[string]string{
"status": `{"Type":1,"Template":"Status for {{command}}\n\n Details"}`,
},
expected: "\nStatus for build\n\n Details\n",
},
{
doc: "omitted type defaults to next steps",
responses: map[string]string{
"suggestion": `{"Template":"Try another command"}`,
},
expected: header + " Try another command\n",
},
{
doc: "generic messages precede shared next steps header",
responses: map[string]string{
"statusone": `{"Type":1,"Template":"Session active"}`,
"statustwo": `{"Type":1,"Template":"Session active"}`,
"suggestionone": `{"Type":0,"Template":"Try another command"}`,
"suggestiontwo": `{"Type":0,"Template":"Try another command"}`,
},
expected: "\nSession active\nSession active\n" + header + " Try another command\n Try another command\n",
},
{
doc: "empty responses produce no output",
responses: map[string]string{
"status": `{"Type":1,"Template":" \n\t"}`,
"suggestion": `{"Type":0,"Template":""}`,
},
},
{
doc: "empty generic message does not affect next steps",
responses: map[string]string{
"status": `{"Type":1,"Template":""}`,
"suggestion": `{"Type":0,"Template":"Try another command"}`,
},
expected: header + " Try another command\n",
},
{
doc: "invalid responses do not affect other plugins",
responses: map[string]string{
"unknown": `{"Type":99,"Template":"Ignored"}`,
"invalid": `{"Type":1,"Template":"{{"}`,
"status": `{"Type":1,"Template":"Session active"}`,
"suggestion": `{"Type":0,"Template":"Try another command"}`,
},
expected: "\nSession active\n" + header + " Try another command\n",
},
} {
t.Run(tc.doc, func(t *testing.T) {
pluginDir := t.TempDir()
cfg := configfile.New("")
cfg.CLIPluginsExtraDirs = []string{pluginDir}
cfg.Plugins = make(map[string]map[string]string)
for name, response := range tc.responses {
plugin := fmt.Sprintf(`#!/bin/sh
case "$1" in
docker-cli-plugin-metadata)
printf '%%s\n' '{"SchemaVersion":"0.1.0","Vendor":"test"}'
;;
*)
test "$2" = docker-cli-plugin-hooks || exit 1
printf 'called\n' >> "$0.calls"
printf '%%s\n' '%s'
;;
esac
`, response)
assert.NilError(t, os.WriteFile(filepath.Join(pluginDir, "docker-"+name), []byte(plugin), 0o755))
cfg.Plugins[name] = map[string]string{"hooks": "build"}
}
root := &cobra.Command{Use: "docker"}
sub := &cobra.Command{Use: "build"}
root.AddCommand(sub)
var output strings.Builder
sub.SetErr(&output)
runHooks(context.Background(), cfg, root, sub, "build", nil, "")
assert.Equal(t, output.String(), tc.expected)
for name := range tc.responses {
calls, err := os.ReadFile(filepath.Join(pluginDir, "docker-"+name+".calls"))
assert.NilError(t, err)
assert.Equal(t, string(calls), "called\n", "each plugin hook must run exactly once")
}
})
}
}
+6 -3
View File
@@ -1,3 +1,6 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package manager
import (
@@ -6,7 +9,7 @@ import (
"os"
"os/exec"
"path/filepath"
"sort"
slices "slices"
"strings"
"sync"
@@ -164,8 +167,8 @@ func ListPlugins(dockerCli config.Provider, rootcmd *cobra.Command) ([]Plugin, e
return nil, err
}
sort.Slice(plugins, func(i, j int) bool {
return sortorder.NaturalLess(plugins[i].Name, plugins[j].Name)
slices.SortFunc(plugins, func(a, b Plugin) int {
return sortorder.NaturalCompare(a.Name, b.Name)
})
return plugins, nil
+4 -2
View File
@@ -1,3 +1,6 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package manager
import (
@@ -167,8 +170,7 @@ func (p *Plugin) RunHook(ctx context.Context, hookData hooks.Request) ([]byte, e
out, err := pCmd.Output()
if err != nil {
var exitErr *exec.ExitError
if errors.As(err, &exitErr) {
if _, ok := errors.AsType[*exec.ExitError](err); ok {
return nil, wrapAsPluginError(err, "plugin hook subcommand exited unsuccessfully")
}
return nil, wrapAsPluginError(err, "failed to execute plugin hook subcommand: "+pCmd.String())
+6
View File
@@ -1,3 +1,6 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package metadata
const (
@@ -35,4 +38,7 @@ type Metadata struct {
URL string `json:",omitempty"`
// Hidden hides the plugin in completion and help message output.
Hidden bool `json:",omitempty"`
// Features declares optional contracts supported by the plugin, keyed by
// feature name.
Features map[string]any `json:",omitempty"`
}
+4 -2
View File
@@ -1,3 +1,6 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package plugin
import (
@@ -97,8 +100,7 @@ func Run(makeCmd func(command.Cli) *cobra.Command, meta metadata.Metadata, ops .
plugin := makeCmd(dockerCLI)
if err := RunPlugin(dockerCLI, plugin, meta); err != nil {
var stErr cli.StatusError
if errors.As(err, &stErr) {
if stErr, ok := errors.AsType[cli.StatusError](err); ok {
// StatusError should only be used for errors, and all errors should
// have a non-zero exit status, so never exit with 0
if stErr.StatusCode == 0 { // FIXME(thaJeztah): this should never be used with a zero status-code. Check if we do this anywhere.
+6 -3
View File
@@ -1,9 +1,12 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package cli
import (
"fmt"
"os"
"sort"
"slices"
"strings"
"github.com/docker/cli/cli-plugins/metadata"
@@ -273,8 +276,8 @@ func topCommands(cmd *cobra.Command) []*cobra.Command {
cmds = append(cmds, sub)
}
}
sort.SliceStable(cmds, func(i, j int) bool {
return sortorder.NaturalLess(cmds[i].Annotations["category-top"], cmds[j].Annotations["category-top"])
slices.SortStableFunc(cmds, func(a, b *cobra.Command) int {
return sortorder.NaturalCompare(a.Annotations["category-top"], b.Annotations["category-top"])
})
return cmds
}
+19 -2
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package command
@@ -68,6 +68,7 @@ type DockerCli struct {
serverInfo ServerInfo
contextStore store.Store
currentContext string
contextResolver func(*DockerCli) (string, error)
init sync.Once
initErr error
dockerEndpoint docker.Endpoint
@@ -208,6 +209,8 @@ func (cli *DockerCli) HooksEnabled() bool {
// Initialize the dockerCli runs initialization that must happen after command
// line flags are parsed.
//
//nolint:gocyclo
func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...CLIOption) error {
for _, o := range ops {
if err := o(cli); err != nil {
@@ -257,6 +260,16 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...CLIOption)
},
}
if cli.contextResolver != nil {
contextName, err := cli.contextResolver(cli)
if err != nil {
return err
}
if contextName != "" {
cli.currentContext = contextName
}
}
// TODO(krissetto): pass ctx to the funcs instead of using this
if cli.enableGlobalMeter {
cli.createGlobalMeterProvider(cli.baseCtx)
@@ -316,7 +329,11 @@ func newAPIClientFromEndpoint(ep docker.Endpoint, configFile *configfile.ConfigF
opts = append(opts, withCustomHeaders)
}
opts = append(opts, extraOpts...)
return client.New(opts...)
apiClient, err := client.New(opts...)
if err != nil {
return nil, err
}
return apiClient, nil
}
func resolveDockerEndpoint(s store.Reader, contextName string) (docker.Endpoint, error) {
+13
View File
@@ -84,6 +84,19 @@ func WithDefaultContextStoreConfig() CLIOption {
}
}
// WithContextResolver overrides context selection during [DockerCli.Initialize].
// The resolver runs after configuration and the context store are loaded, but
// before telemetry and endpoint initialization.
// An empty result preserves normal context selection; an error aborts
// initialization.
// The resolver must not initialize the API client.
func WithContextResolver(resolve func(*DockerCli) (string, error)) CLIOption {
return func(cli *DockerCli) error {
cli.contextResolver = resolve
return nil
}
}
// WithAPIClient configures the cli to use the given API client.
func WithAPIClient(c client.APIClient) CLIOption {
return func(cli *DockerCli) error {
+67
View File
@@ -132,6 +132,15 @@ func TestNewAPIClientFromFlagsWithAPIVersionFromEnv(t *testing.T) {
assert.Equal(t, apiclient.ClientVersion(), expectedVersion)
}
func TestNewAPIClientFromFlagsWithInvalidAPIVersionFromEnv(t *testing.T) {
t.Setenv("DOCKER_API_VERSION", "1")
t.Setenv("DOCKER_HOST", ":2375")
apiClient, err := NewAPIClientFromFlags(&flags.ClientOptions{}, &configfile.ConfigFile{})
assert.ErrorContains(t, err, "invalid API version")
assert.Check(t, apiClient == nil)
}
type fakeClient struct {
client.Client
pingFunc func() (client.PingResult, error)
@@ -316,6 +325,64 @@ func TestInitializeShouldAlwaysCreateTheContextStore(t *testing.T) {
assert.Check(t, cli.ContextStore() != nil)
}
func TestInitializeContextResolver(t *testing.T) {
resolverErr := errors.New("resolver failed")
for _, tc := range []struct {
name string
context string
err error
}{
{name: "resolved context", context: "resolved"},
{name: "normal selection"},
{name: "resolver failure", err: resolverErr},
} {
t.Run(tc.name, func(t *testing.T) {
originalConfigDir := config.Dir()
t.Cleanup(func() { config.SetDir(originalConfigDir) })
config.SetDir(t.TempDir())
configDir := t.TempDir()
cfg := configfile.New(filepath.Join(configDir, config.ConfigFileName))
cfg.Features = map[string]string{"cloud": "foobar"}
assert.NilError(t, cfg.Save())
cli, err := NewDockerCli()
assert.NilError(t, err)
var loadedConfig *configfile.ConfigFile
calls := 0
err = cli.Initialize(&flags.ClientOptions{ConfigDir: configDir, Context: "original"},
WithContextResolver(func(cli *DockerCli) (string, error) {
calls++
assert.Equal(t, config.Dir(), configDir)
loadedConfig = cli.ConfigFile()
assert.Equal(t, loadedConfig.Features["cloud"], "foobar")
assert.Assert(t, cli.ContextStore() != nil)
assert.Assert(t, cli.client == nil)
return tc.context, tc.err
}),
)
assert.Equal(t, calls, 1)
assert.Assert(t, cli.ConfigFile() == loadedConfig)
assert.Assert(t, cli.client == nil)
if tc.err != nil {
assert.ErrorIs(t, err, tc.err)
return
}
assert.NilError(t, err)
wantContext := tc.context
if wantContext == "" {
wantContext = "original"
}
assert.Equal(t, cli.CurrentContext(), wantContext)
})
}
}
func TestHooksEnabled(t *testing.T) {
t.Run("disabled by default", func(t *testing.T) {
// Make sure we don't depend on any existing ~/.docker/config.json
+4 -3
View File
@@ -3,9 +3,9 @@ package completion
import (
"context"
"errors"
"sort"
"testing"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/moby/moby/api/types/container"
"github.com/moby/moby/api/types/image"
"github.com/moby/moby/api/types/network"
@@ -177,9 +177,10 @@ func TestCompleteEnvVarNames(t *testing.T) {
values, directives := EnvVarNames()(nil, nil, "")
assert.Check(t, is.Equal(directives&cobra.ShellCompDirectiveNoFileComp, cobra.ShellCompDirectiveNoFileComp), "Should not perform file completion")
sort.Strings(values)
expected := []string{"ENV_A", "ENV_B"}
assert.Check(t, is.DeepEqual(values, expected))
assert.Check(t, is.DeepEqual(values, expected, cmpopts.SortSlices(func(a, b string) bool {
return a < b
})))
}
func TestCompleteFileNames(t *testing.T) {
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package config
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package config
+7 -3
View File
@@ -1,8 +1,11 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package config
import (
"context"
"sort"
"slices"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
@@ -10,6 +13,7 @@ import (
flagsHelper "github.com/docker/cli/cli/flags"
"github.com/docker/cli/opts"
"github.com/fvbommel/sortorder"
"github.com/moby/moby/api/types/swarm"
"github.com/moby/moby/client"
"github.com/spf13/cobra"
)
@@ -62,8 +66,8 @@ func runList(ctx context.Context, dockerCLI command.Cli, options listOptions) er
}
}
sort.Slice(res.Items, func(i, j int) bool {
return sortorder.NaturalLess(res.Items[i].Spec.Name, res.Items[j].Spec.Name)
slices.SortFunc(res.Items, func(a, b swarm.Config) int {
return sortorder.NaturalCompare(a.Spec.Name, b.Spec.Name)
})
configCtx := formatter.Context{
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package container
+4 -4
View File
@@ -7,7 +7,6 @@ import (
"os"
"path/filepath"
"runtime"
"sort"
"strings"
"testing"
@@ -15,6 +14,7 @@ import (
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/internal/test"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/moby/moby/api/types/container"
"github.com/moby/moby/api/types/system"
"github.com/moby/moby/client"
@@ -284,12 +284,12 @@ func TestCreateContainerWithProxyConfig(t *testing.T) {
"ALL_PROXY=allProxy",
"all_proxy=allProxy",
}
sort.Strings(expected)
fakeCLI := test.NewFakeCli(&fakeClient{
createContainerFunc: func(options client.ContainerCreateOptions) (client.ContainerCreateResult, error) {
sort.Strings(options.Config.Env)
assert.DeepEqual(t, options.Config.Env, expected)
assert.DeepEqual(t, options.Config.Env, expected, cmpopts.SortSlices(func(a, b string) bool {
return a < b
}))
return client.ContainerCreateResult{}, nil
},
})
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package container
+6 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package container
@@ -139,6 +139,7 @@ type containerOptions struct {
runtime string
autoRemove bool
init bool
umask opts.UmaskOpt
annotations *opts.MapOpts
Image string
@@ -313,6 +314,9 @@ func addFlags(flags *pflag.FlagSet) *containerOptions {
flags.Var(&copts.shmSize, "shm-size", "Size of /dev/shm")
flags.StringVar(&copts.utsMode, "uts", "", "UTS namespace to use")
flags.StringVar(&copts.runtime, "runtime", "", "Runtime to use for this container")
flags.Var(&copts.umask, "umask", "Set umask for the container")
flags.SetAnnotation("umask", "version", []string{"1.56"})
flags.SetAnnotation("umask", "ostype", []string{"linux"})
flags.BoolVar(&copts.init, "init", false, "Run an init inside the container that forwards signals and reaps processes")
flags.SetAnnotation("init", "version", []string{"1.25"})
@@ -710,6 +714,7 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
MaskedPaths: maskedPaths,
ReadonlyPaths: readonlyPaths,
Annotations: copts.annotations.GetAll(),
Umask: copts.umask.Value(),
}
if copts.autoRemove && !hostConfig.RestartPolicy.IsNone() {
+13
View File
@@ -154,6 +154,19 @@ func TestParseRunLinks(t *testing.T) {
}
}
func TestParseRunWithoutUmask(t *testing.T) {
_, hostConfig, _, err := parseRun([]string{"ubuntu", "bash"})
assert.NilError(t, err)
assert.Assert(t, hostConfig.Umask == nil)
}
func TestParseRunUmask(t *testing.T) {
_, hostConfig, _, err := parseRun([]string{"--umask", "0022", "ubuntu", "bash"})
assert.NilError(t, err)
assert.Assert(t, hostConfig.Umask != nil)
assert.Equal(t, uint32(0o22), *hostConfig.Umask)
}
func TestParseRunAttach(t *testing.T) {
tests := []struct {
input string
+5 -4
View File
@@ -1,10 +1,13 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package container
import (
"context"
"fmt"
"net"
"sort"
"slices"
"strings"
"github.com/docker/cli/cli"
@@ -80,9 +83,7 @@ func runPort(ctx context.Context, dockerCli command.Cli, opts *portOptions) erro
}
if len(out) > 0 {
sort.Slice(out, func(i, j int) bool {
return sortorder.NaturalLess(out[i], out[j])
})
slices.SortFunc(out, sortorder.NaturalCompare)
_, _ = fmt.Fprintln(dockerCli.Out(), strings.Join(out, "\n"))
}
+4 -3
View File
@@ -4,11 +4,11 @@ import (
"context"
"errors"
"io"
"sort"
"sync"
"testing"
"github.com/docker/cli/internal/test"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/moby/moby/client"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
@@ -87,8 +87,9 @@ func TestRestart(t *testing.T) {
} else {
assert.Check(t, is.Nil(err))
}
sort.Strings(restarted)
assert.Check(t, is.DeepEqual(restarted, tc.restarted))
assert.Check(t, is.DeepEqual(restarted, tc.restarted, cmpopts.SortSlices(func(a, b string) bool {
return a < b
})))
})
}
}
+5 -3
View File
@@ -4,11 +4,11 @@ import (
"context"
"errors"
"io"
"sort"
"sync"
"testing"
"github.com/docker/cli/internal/test"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/moby/moby/client"
"gotest.tools/v3/assert"
)
@@ -53,8 +53,10 @@ func TestRemoveForce(t *testing.T) {
assert.NilError(t, err)
}
assert.Equal(t, cli.ErrBuffer().String(), "")
sort.Strings(removed)
assert.DeepEqual(t, removed, []string{"mycontainer", "nosuchcontainer"})
expected := []string{"mycontainer", "nosuchcontainer"}
assert.DeepEqual(t, removed, expected, cmpopts.SortSlices(func(a, b string) bool {
return a < b
}))
})
}
}
+4 -2
View File
@@ -1,3 +1,6 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package container
import (
@@ -169,8 +172,7 @@ func RunStart(ctx context.Context, dockerCli command.Cli, opts *StartOptions) er
}
}
if attachErr := <-cErr; attachErr != nil {
var escapeError term.EscapeError
if errors.As(attachErr, &escapeError) {
if _, ok := errors.AsType[term.EscapeError](attachErr); ok {
// The user entered the detach escape sequence.
return nil
}
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package container
+4 -3
View File
@@ -4,11 +4,11 @@ import (
"context"
"errors"
"io"
"sort"
"sync"
"testing"
"github.com/docker/cli/internal/test"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/moby/moby/client"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
@@ -88,8 +88,9 @@ func TestStop(t *testing.T) {
} else {
assert.Check(t, is.Nil(err))
}
sort.Strings(stopped)
assert.Check(t, is.DeepEqual(stopped, tc.stopped))
assert.Check(t, is.DeepEqual(stopped, tc.stopped, cmpopts.SortSlices(func(a, b string) bool {
return a < b
})))
})
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package container
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package command
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package context
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package context
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package context
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package context
+4 -4
View File
@@ -1,12 +1,12 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package context
import (
"fmt"
"os"
"sort"
"slices"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
@@ -101,8 +101,8 @@ func runList(dockerCli command.Cli, opts *listOptions) error {
Error: errMsg,
})
}
sort.Slice(contexts, func(i, j int) bool {
return sortorder.NaturalLess(contexts[i].Name, contexts[j].Name)
slices.SortFunc(contexts, func(a, b *formatter.ClientContext) int {
return sortorder.NaturalCompare(a.Name, b.Name)
})
if err := format(dockerCli, opts, contexts); err != nil {
return err
+4 -2
View File
@@ -1,3 +1,6 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package context
import (
@@ -69,8 +72,7 @@ func parseBool(config map[string]string, name string) (bool, error) {
}
res, err := strconv.ParseBool(strVal)
if err != nil {
var nErr *strconv.NumError
if errors.As(err, &nErr) {
if nErr, ok := errors.AsType[*strconv.NumError](err); ok {
return res, fmt.Errorf("%s: parsing %q: %w", name, nErr.Num, nErr.Err)
}
return res, fmt.Errorf("%s: %w", name, err)
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package command
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package command
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package command
+16 -13
View File
@@ -1,7 +1,10 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package formatter
import (
"sort"
"slices"
"strconv"
"strings"
"time"
@@ -52,20 +55,20 @@ shared: {{.Shared}}
}
func buildCacheSort(buildCache []build.CacheRecord) {
sort.Slice(buildCache, func(i, j int) bool {
lui, luj := buildCache[i].LastUsedAt, buildCache[j].LastUsedAt
slices.SortFunc(buildCache, func(a, b build.CacheRecord) int {
switch {
case lui == nil && luj == nil:
return strings.Compare(buildCache[i].ID, buildCache[j].ID) < 0
case lui == nil:
return true
case luj == nil:
return false
case lui.Equal(*luj):
return strings.Compare(buildCache[i].ID, buildCache[j].ID) < 0
default:
return lui.Before(*luj)
case a.LastUsedAt == nil && b.LastUsedAt == nil:
return strings.Compare(a.ID, b.ID)
case a.LastUsedAt == nil:
return -1
case b.LastUsedAt == nil:
return 1
}
if c := a.LastUsedAt.Compare(*b.LastUsedAt); c != 0 {
return c
}
return strings.Compare(a.ID, b.ID)
})
}
+14 -20
View File
@@ -1,12 +1,13 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package formatter
import (
"cmp"
"fmt"
"net"
"sort"
"slices"
"strconv"
"strings"
"time"
@@ -295,7 +296,7 @@ func (c *ContainerContext) Labels() string {
for k, v := range c.c.Labels {
joinLabels = append(joinLabels, k+"="+v)
}
sort.Strings(joinLabels)
slices.Sort(joinLabels)
return strings.Join(joinLabels, ",")
}
@@ -395,9 +396,7 @@ func DisplayablePorts(ports []container.PortSummary) string {
var result []string
var hostMappings []string
var groupMapKeys []string
sort.Slice(ports, func(i, j int) bool {
return comparePorts(ports[i], ports[j])
})
slices.SortFunc(ports, comparePorts)
for _, port := range ports {
current := port.PrivatePort
@@ -452,18 +451,13 @@ func formGroup(key string, start, last uint16) string {
return group + "/" + groupType
}
func comparePorts(i, j container.PortSummary) bool {
if i.PrivatePort != j.PrivatePort {
return i.PrivatePort < j.PrivatePort
}
if i.IP != j.IP {
return i.IP.String() < j.IP.String()
}
if i.PublicPort != j.PublicPort {
return i.PublicPort < j.PublicPort
}
return i.Type < j.Type
// comparePorts compares ports by private port, IP address, public port,
// and protocol, in that order.
func comparePorts(a, b container.PortSummary) int {
return cmp.Or(
cmp.Compare(a.PrivatePort, b.PrivatePort),
a.IP.Compare(b.IP),
cmp.Compare(a.PublicPort, b.PublicPort),
cmp.Compare(a.Type, b.Type),
)
}
+19 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package formatter
@@ -946,6 +946,24 @@ func TestDisplayablePorts(t *testing.T) {
},
expected: "80/tcp, 80/udp, 1024/tcp, 1024/udp, 12345/sctp, 1.1.1.1:1024->80/tcp, 1.1.1.1:1024->80/udp, 2.1.1.1:1024->80/tcp, 2.1.1.1:1024->80/udp, 1.1.1.1:80->1024/tcp, 1.1.1.1:80->1024/udp, 2.1.1.1:80->1024/tcp, 2.1.1.1:80->1024/udp", //nolint:revive // ignore line-length-limit (revive)
},
{
// host IPs are ordered numerically, not lexicographically:
// "10.0.0.2" sorts as a string before "9.0.0.1".
ports: []container.PortSummary{
{
IP: netip.MustParseAddr("10.0.0.2"),
PublicPort: 8080,
PrivatePort: 80,
Type: "tcp",
}, {
IP: netip.MustParseAddr("9.0.0.1"),
PublicPort: 8081,
PrivatePort: 80,
Type: "tcp",
},
},
expected: "9.0.0.1:8081->80/tcp, 10.0.0.2:8080->80/tcp",
},
}
for _, port := range cases {
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package formatter
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package formatter
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package formatter
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package formatter
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package formatter
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package formatter
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package formatter
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package formatter
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package idresolver
+9 -4
View File
@@ -1,3 +1,6 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package image
import (
@@ -257,8 +260,11 @@ func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions)
contextDir = tempDir
case build.ContextTypeRemote:
buildCtx, relDockerfile, err = build.GetContextFromURL(progBuff, options.context, options.dockerfileName)
if err != nil && options.quiet {
_, _ = fmt.Fprintln(dockerCli.Err(), progBuff)
if err != nil {
if options.quiet {
_, _ = fmt.Fprintln(dockerCli.Err(), progBuff)
}
return err
}
default:
return fmt.Errorf("unable to prepare context: path %q not found", options.context)
@@ -364,8 +370,7 @@ func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions)
err = jsonstream.Display(ctx, response.Body, streams.NewOut(buildBuff), jsonstream.WithAuxCallback(aux))
if err != nil {
var jerr *jsonstream.JSONError
if errors.As(err, &jerr) {
if jerr, ok := errors.AsType[*jsonstream.JSONError](err); ok {
// If no error code is set, default to 1
if jerr.Code == 0 {
jerr.Code = 1
@@ -1,3 +1,6 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package git
import (
@@ -7,6 +10,7 @@ import (
"os"
"os/exec"
"path/filepath"
"slices"
"strings"
"github.com/moby/sys/symlink"
@@ -202,7 +206,7 @@ func (repo gitRepo) checkout(root string) (string, error) {
}
func (repo gitRepo) gitWithinDir(dir string, args ...string) ([]byte, error) {
args = append([]string{"-c", "protocol.file.allow=never"}, args...) // Block sneaky repositories from using repos from the filesystem as submodules.
args = slices.Concat([]string{"-c", "protocol.file.allow=never"}, args) // Block sneaky repositories from using repos from the filesystem as submodules.
cmd := exec.Command("git", args...)
cmd.Dir = dir
// Disable unsafe remote protocols.
+33 -2
View File
@@ -6,9 +6,11 @@ import (
"compress/gzip"
"context"
"io"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"sort"
"slices"
"testing"
"github.com/docker/cli/cli/streams"
@@ -172,6 +174,35 @@ RUN echo hello world
assert.DeepEqual(t, fakeBuild.filenames(t), []string{"Dockerfile"})
}
// TestRunBuildRemoteContextDownloadError verifies that remote context
// download errors are propagated.
//
// regression test for https://github.com/docker/cli/issues/7372
func TestRunBuildRemoteContextDownloadError(t *testing.T) {
t.Setenv("DOCKER_BUILDKIT", "0")
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
http.Error(w, "not found", http.StatusNotFound)
}))
defer server.Close()
imageBuildCalled := false
cli := test.NewFakeCli(&fakeClient{
imageBuildFunc: func(ctx context.Context, buildContext io.Reader, options client.ImageBuildOptions) (client.ImageBuildResult, error) {
imageBuildCalled = true
return client.ImageBuildResult{Body: io.NopCloser(bytes.NewReader(nil))}, nil
},
})
options := newBuildOptions()
options.context = server.URL
err := runBuild(context.Background(), cli, options)
assert.ErrorContains(t, err, "unable to download remote context")
assert.Assert(t, !imageBuildCalled, "ImageBuild should not be called when downloading the remote context fails")
}
type fakeBuild struct {
context *tar.Reader
options client.ImageBuildOptions
@@ -211,6 +242,6 @@ func (f *fakeBuild) filenames(t *testing.T) []string {
for _, header := range h {
names = append(names, header.Name)
}
sort.Strings(names)
slices.Sort(names)
return names
}
+8 -3
View File
@@ -52,6 +52,14 @@ func TestNewHistoryCommandErrors(t *testing.T) {
}
func TestNewHistoryCommandSuccess(t *testing.T) {
// Set to UTC timezone as timestamps in output are
// printed in the current timezone
local := time.Local
time.Local = time.UTC
t.Cleanup(func() {
time.Local = local
})
testCases := []struct {
name string
args []string
@@ -118,9 +126,6 @@ func TestNewHistoryCommandSuccess(t *testing.T) {
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
// Set to UTC timezone as timestamps in output are
// printed in the current timezone
t.Setenv("TZ", "UTC")
cli := test.NewFakeCli(&fakeClient{imageHistoryFunc: tc.imageHistoryFunc})
cmd := newHistoryCommand(cli)
cmd.SetOut(io.Discard)
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package image
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package image
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package image
+5 -3
View File
@@ -102,9 +102,11 @@ func TestRunPushRespectsNoColorForAuxNotes(t *testing.T) {
SelectedManifest: ocispec.Descriptor{Digest: "sha256:2222222222222222222222222222222222222222222222222222222222222222"},
})
assert.NilError(t, err)
line := append([]byte(`{"aux":`), aux...)
line = append(line, '}', '\n')
return fakeStreamResult{ReadCloser: io.NopCloser(bytes.NewReader(line))}, nil
var buf bytes.Buffer
buf.WriteString(`{"aux":`)
buf.Write(aux)
buf.WriteString("}\n")
return fakeStreamResult{ReadCloser: io.NopCloser(&buf)}, nil
},
})
cli.Out().SetIsTerminal(true)
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package image
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package inspect
+2 -24
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package manifest
@@ -48,27 +48,6 @@ func newManifestStore(dockerCLI command.Cli) store.Store {
return store.NewStore(filepath.Join(config.Dir(), "manifests"))
}
// authConfigKey is the key used to store credentials for Docker Hub. It is
// a copy of [registry.IndexServer].
//
// [registry.IndexServer]: https://pkg.go.dev/github.com/docker/docker@v28.3.3+incompatible/registry#IndexServer
const authConfigKey = "https://index.docker.io/v1/"
// getAuthConfigKey special-cases using the full index address of the official
// index as the AuthConfig key, and uses the (host)name[:port] for private indexes.
//
// It is similar to [registry.GetAuthConfigKey], but does not require on
// [registrytypes.IndexInfo] as intermediate.
//
// [registry.GetAuthConfigKey]: https://pkg.go.dev/github.com/docker/docker@v28.3.3+incompatible/registry#GetAuthConfigKey
// [registrytypes.IndexInfo]: https://pkg.go.dev/github.com/docker/docker@v28.3.3+incompatible/api/types/registry#IndexInfo
func getAuthConfigKey(domainName string) string {
if domainName == "docker.io" || domainName == "index.docker.io" {
return authConfigKey
}
return domainName
}
// newRegistryClient returns a client for communicating with a Docker distribution
// registry
func newRegistryClient(dockerCLI command.Cli, allowInsecure bool) registryclient.RegistryClient {
@@ -78,8 +57,7 @@ func newRegistryClient(dockerCLI command.Cli, allowInsecure bool) registryclient
}
cfg := dockerCLI.ConfigFile()
resolver := func(ctx context.Context, domainName string) registry.AuthConfig {
configKey := getAuthConfigKey(domainName)
a, _ := cfg.GetAuthConfig(configKey)
a, _ := cfg.GetAuthConfig(domainName)
return registry.AuthConfig{
Username: a.Username,
Password: a.Password,
+6 -10
View File
@@ -189,8 +189,6 @@ func TestNetworkCreateWithFlags(t *testing.T) {
// TestNetworkCreateIPv4 verifies behavior of the "--ipv4" option. This option
// is an optional bool, and must default to "nil", not "true" or "false".
func TestNetworkCreateIPv4(t *testing.T) {
boolPtr := func(val bool) *bool { return &val }
tests := []struct {
doc, name string
flags []string
@@ -205,19 +203,19 @@ func TestNetworkCreateIPv4(t *testing.T) {
doc: "IPv4 enabled",
name: "ipv4-enabled",
flags: []string{"--ipv4=true"},
expected: boolPtr(true),
expected: new(true),
},
{
doc: "IPv4 enabled (shorthand)",
name: "ipv4-enabled-shorthand",
flags: []string{"--ipv4"},
expected: boolPtr(true),
expected: new(true),
},
{
doc: "IPv4 disabled",
name: "ipv4-disabled",
flags: []string{"--ipv4=false"},
expected: boolPtr(false),
expected: new(false),
},
}
@@ -243,8 +241,6 @@ func TestNetworkCreateIPv4(t *testing.T) {
// TestNetworkCreateIPv6 verifies behavior of the "--ipv6" option. This option
// is an optional bool, and must default to "nil", not "true" or "false".
func TestNetworkCreateIPv6(t *testing.T) {
strPtr := func(val bool) *bool { return &val }
tests := []struct {
doc, name string
flags []string
@@ -259,19 +255,19 @@ func TestNetworkCreateIPv6(t *testing.T) {
doc: "IPV6 enabled",
name: "ipv6-enabled",
flags: []string{"--ipv6=true"},
expected: strPtr(true),
expected: new(true),
},
{
doc: "IPV6 enabled (shorthand)",
name: "ipv6-enabled-shorthand",
flags: []string{"--ipv6"},
expected: strPtr(true),
expected: new(true),
},
{
doc: "IPV6 disabled",
name: "ipv6-disabled",
flags: []string{"--ipv6=false"},
expected: strPtr(false),
expected: new(false),
},
}
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package network
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package network
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package network
+7 -3
View File
@@ -1,8 +1,11 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package network
import (
"context"
"sort"
"slices"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
@@ -10,6 +13,7 @@ import (
flagsHelper "github.com/docker/cli/cli/flags"
"github.com/docker/cli/opts"
"github.com/fvbommel/sortorder"
"github.com/moby/moby/api/types/network"
"github.com/moby/moby/client"
"github.com/spf13/cobra"
)
@@ -61,8 +65,8 @@ func runList(ctx context.Context, dockerCLI command.Cli, options listOptions) er
}
}
sort.Slice(res.Items, func(i, j int) bool {
return sortorder.NaturalLess(res.Items[i].Name, res.Items[j].Name)
slices.SortFunc(res.Items, func(a, b network.Summary) int {
return sortorder.NaturalCompare(a.Name, b.Name)
})
networksCtx := formatter.Context{
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package node
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package node
+7 -3
View File
@@ -1,8 +1,11 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package node
import (
"context"
"sort"
"slices"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
@@ -10,6 +13,7 @@ import (
flagsHelper "github.com/docker/cli/cli/flags"
"github.com/docker/cli/opts"
"github.com/fvbommel/sortorder"
"github.com/moby/moby/api/types/swarm"
"github.com/moby/moby/client"
"github.com/spf13/cobra"
)
@@ -73,8 +77,8 @@ func runList(ctx context.Context, dockerCLI command.Cli, options listOptions) er
Output: dockerCLI.Out(),
Format: newFormat(format, options.quiet),
}
sort.Slice(res.Items, func(i, j int) bool {
return sortorder.NaturalLess(res.Items[i].Description.Hostname, res.Items[j].Description.Hostname)
slices.SortFunc(res.Items, func(a, b swarm.Node) int {
return sortorder.NaturalCompare(a.Description.Hostname, b.Description.Hostname)
})
return formatWrite(nodesCtx, res, info)
}
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package node
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package plugin
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package plugin
+7 -3
View File
@@ -1,8 +1,11 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package plugin
import (
"context"
"sort"
"slices"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
@@ -10,6 +13,7 @@ import (
flagsHelper "github.com/docker/cli/cli/flags"
"github.com/docker/cli/opts"
"github.com/fvbommel/sortorder"
"github.com/moby/moby/api/types/plugin"
"github.com/moby/moby/client"
"github.com/spf13/cobra"
)
@@ -54,8 +58,8 @@ func runList(ctx context.Context, dockerCli command.Cli, options listOptions) er
return err
}
sort.Slice(resp.Items, func(i, j int) bool {
return sortorder.NaturalLess(resp.Items[i].Name, resp.Items[j].Name)
slices.SortFunc(resp.Items, func(a, b plugin.Plugin) int {
return sortorder.NaturalCompare(a.Name, b.Name)
})
format := options.format
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package secret
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package secret
+7 -3
View File
@@ -1,8 +1,11 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package secret
import (
"context"
"sort"
"slices"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
@@ -10,6 +13,7 @@ import (
flagsHelper "github.com/docker/cli/cli/flags"
"github.com/docker/cli/opts"
"github.com/fvbommel/sortorder"
"github.com/moby/moby/api/types/swarm"
"github.com/moby/moby/client"
"github.com/spf13/cobra"
)
@@ -59,8 +63,8 @@ func runSecretList(ctx context.Context, dockerCLI command.Cli, options listOptio
}
}
sort.Slice(res.Items, func(i, j int) bool {
return sortorder.NaturalLess(res.Items[i].Spec.Name, res.Items[j].Spec.Name)
slices.SortFunc(res.Items, func(a, b swarm.Secret) int {
return sortorder.NaturalCompare(a.Spec.Name, b.Spec.Name)
})
secretCtx := formatter.Context{
+15 -12
View File
@@ -1,9 +1,13 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26
package service
import (
"cmp"
"errors"
"fmt"
"sort"
"slices"
"strconv"
"strings"
"time"
@@ -615,8 +619,8 @@ func NewListFormat(source string, quiet bool) formatter.Format {
// ListFormatWrite writes the context
func ListFormatWrite(ctx formatter.Context, services client.ServiceListResult) error {
render := func(format func(subContext formatter.SubContext) error) error {
sort.Slice(services.Items, func(i, j int) bool {
return sortorder.NaturalLess(services.Items[i].Spec.Name, services.Items[j].Spec.Name)
slices.SortFunc(services.Items, func(a, b swarm.Service) int {
return sortorder.NaturalCompare(a.Spec.Name, b.Spec.Name)
})
for _, service := range services.Items {
serviceCtx := &serviceContext{service: service}
@@ -775,17 +779,16 @@ func (c *serviceContext) Ports() string {
return ""
}
pr := portRange{}
ports := []string{}
servicePorts := c.service.Endpoint.Ports
sort.Slice(servicePorts, func(i, j int) bool {
if servicePorts[i].Protocol == servicePorts[j].Protocol {
return servicePorts[i].PublishedPort < servicePorts[j].PublishedPort
}
return servicePorts[i].Protocol < servicePorts[j].Protocol
// Sort by protocol first, then by published port.
slices.SortFunc(c.service.Endpoint.Ports, func(a, b swarm.PortConfig) int {
return cmp.Or(
cmp.Compare(a.Protocol, b.Protocol),
cmp.Compare(a.PublishedPort, b.PublishedPort),
)
})
var pr portRange
var ports []string
for _, p := range c.service.Endpoint.Ports {
if p.PublishMode == swarm.PortConfigPublishModeIngress {
prIsRange := pr.tEnd != pr.tStart
+1 -1
View File
@@ -1,5 +1,5 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.25
//go:build go1.26
package service

Some files were not shown because too many files have changed in this diff Show More