Compare commits

...

407 Commits

Author SHA1 Message Date
Austin Vazquez
4e04130911 Merge pull request #51410 from austinvazquez/test-containerd-1.7.29
[28.x] Dockerfile: test containerd v1.7.29
2025-11-05 21:10:10 -06:00
Austin Vazquez
f5cacc257a Dockerfile: test containerd v1.7.29
Update the version of containerd used in CI and for static binaries
to v1.7.29

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-11-05 19:25:41 -06:00
Paweł Gronowski
89c5e8fd66 Merge pull request #51396 from thaJeztah/28.x_backport_api_docs
[28.x backport] api/docs: remove BuildCache.Parent field for API v1.42 and up
2025-11-05 15:19:32 +01:00
Austin Vazquez
9b93878308 Merge pull request #51395 from thaJeztah/28.x_backport_rootless_reject
[28.x backport] dockerd-rootless.sh: reject DOCKERD_ROOTLESS_ROOTLESSKIT_NET=host
2025-11-05 07:41:12 -06:00
Paweł Gronowski
6178456763 Merge pull request #51398 from vvoland/51397-28.x
[28.x backport] vendor: github.com/moby/buildkit v0.25.2
2025-11-05 14:14:53 +01:00
Paweł Gronowski
0cae4e5c8f vendor: github.com/moby/buildkit v0.25.2
full diff: https://github.com/moby/buildkit/compare/v0.25.1...v0.25.2

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 39f2dbffa1)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-05 13:18:13 +01:00
Sebastiaan van Stijn
33cc06f616 Merge pull request #51394 from vvoland/51393-28.x
[28.x backport] Dockerfile: update runc binary to v1.3.3
2025-11-05 12:47:15 +01:00
Sebastiaan van Stijn
d525277410 api/docs: remove BuildCache.Parent field for API v1.42 and up
The BuildCache.Parent field was removed in API v1.42 in [moby@e0db820].
While we had to keep the Go struct field around to backfil the field for
older API versions, it's no longer part of API v1.42 and up (using the
"omitempty" is just an implementation detail).

This patch corrects the swagger files to match this.

[moby@e0db820]: e0db8207f3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a5d9619093)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-05 12:04:25 +01:00
Akihiro Suda
2fbc51b4f8 dockerd-rootless.sh: reject DOCKERD_ROOTLESS_ROOTLESSKIT_NET=host
`rootlesskit --net=host` does not work with Docker.

Alternative ways to run Rootless Docker without the network overhead:
- Use https://github.com/rootless-containers/bypass4netns
- Or, use `docker run --net=host` with a PR 47103 (WIP)

See issue 51363

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit 76b1d304e4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-05 12:00:54 +01:00
Paweł Gronowski
bd98008c07 integration-cli: Adjust nofile limits
runc v1.3.3 needs more file descriptors now.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-05 11:31:32 +01:00
Paweł Gronowski
19675151a3 Dockerfile: update runc binary to v1.3.3
Update the version used in CI and for the static binaries.

- release notes: https://github.com/opencontainers/runc/releases/tag/v1.3.3
- full diff: https://github.com/opencontainers/runc/compare/v1.3.2...v1.3.3

This release contains fixes for three high-severity security
vulnerabilities in runc (CVE-2025-31133, CVE-2025-52565, and
CVE-2025-52881). All three vulnerabilities ultimately allow (through
different methods) for full container breakouts by bypassing runc's
restrictions for writing to arbitrary /proc files.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 35f6a78082)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-05 11:00:17 +01:00
Sebastiaan van Stijn
44896604b8 Merge pull request #51387 from thaJeztah/28.x_bump_go
[28.x] update to go1.24.9
2025-11-04 14:50:31 +01:00
Sebastiaan van Stijn
d24eab928b update to go1.24.9
go1.24.9 (released 2025-10-13) includes fixes to the crypto/x509 package.
See the Go 1.24.9 milestone on our issue tracker for details:

- https://github.com/golang/go/issues?q=milestone%3AGo1.24.9+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.24.8...go1.24.9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-04 11:05:26 +01:00
Sebastiaan van Stijn
b651c094e2 Merge pull request #51162 from vvoland/51149-28.x
[28.x backport] dockerd-rootless.sh: if no slirp4netns, try pasta
2025-10-10 13:53:40 +02:00
Rob Murray
df58dd519b dockerd-rootless: default MTU 65520 for slirp4netns
When DOCKERD_ROOTLESS_ROOTLESSKIT_MTU is not set, and ...
- DOCKERD_ROOTLESS_ROOTLESSKIT_NET is not set and slirp4netns
  is selected, MTU defaults to 65520.
- DOCKERD_ROOTLESS_ROOTLESSKIT_NET=slirp4netns, MTU defaults
  to 1500.

Change the logic so that, however slirp4netns is selected, MTU
defaults to 65520.

Signed-off-by: Rob Murray <rob.murray@docker.com>
(cherry picked from commit a6206f2da9)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-10 12:40:00 +02:00
Rob Murray
f822c9f39c dockerd-rootless.sh: if no slirp4netns, try pasta
Signed-off-by: Rob Murray <rob.murray@docker.com>
(cherry picked from commit 7e63d2a81b)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-10 12:39:57 +02:00
Austin Vazquez
f8215cc266 Merge pull request #51137 from austinvazquez/cherry-pick-vendor-buildkit-0.25.1-to-28.x
[28.x] vendor: update buildkit to v0.25.1
2025-10-07 19:34:32 -07:00
Tonis Tiigi
40a856a593 hack: add patch to buildkit tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 1b1608f2cd)
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-07 20:01:53 -05:00
Tonis Tiigi
5d1c3119f2 vendor: update buildkit to v0.25.1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 3c418bea4e)
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-07 20:01:34 -05:00
Austin Vazquez
90506c1144 Merge pull request #51133 from vvoland/51132-28.x
[28.x backport] update to go1.24.8
2025-10-07 16:35:30 -07:00
Austin Vazquez
17db0cd834 Merge pull request #51128 from thaJeztah/28.x_backport_gcpolicy-invalid-calculations
[28.x backport] builder: use proper percentage calculations for default gc policy
2025-10-07 13:56:48 -07:00
Paweł Gronowski
f7c40ea344 update to go1.24.8
This minor release includes 10 security fixes following the security policy:

- net/mail: excessive CPU consumption in ParseAddress

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

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

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

- crypto/x509: quadratic complexity when checking name constraints

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

    This affects programs which validate arbitrary certificate chains.

    Thanks to Jakub Ciolek for reporting this issue.

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

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

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

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

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

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

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

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

    This affects programs which parse untrusted PEM inputs.

    Thanks to Jakub Ciolek for reporting this issue.

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

- net/url: insufficient validation of bracketed IPv6 hostnames

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

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

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

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

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

    Thanks to Jakub Ciolek for reporting this issue.

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

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

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

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

    Thanks to jub0bs for reporting this issue.

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

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

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

    This affects programs which validate arbitrary certificate chains.

    Thanks to Jakub Ciolek for reporting this issue.

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

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

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

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

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

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

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

    Thanks to Jakub Ciolek for reporting this issue.

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

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit d7b4bb25bda9f86dc47bf5a8921ceb8b3a4a498c)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-07 21:50:05 +02:00
Jonathan A. Sternberg
dccf7c889c builder: use proper percentage calculations for default gc policy
The default gc policy calculations based on percentage were calculated
improperly. These were calculated correctly in buildkit, but the
calculation method was not copied over correctly when updating the
values.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
(cherry picked from commit 1a7d7cc015)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-07 19:10:14 +02:00
Sebastiaan van Stijn
0f040aa194 Merge pull request #51126 from vvoland/51124-28.x
[28.x backport] ci: fix cache for go modules
2025-10-07 18:25:08 +02:00
CrazyMax
5b1a039e6f ci: fix cache for go modules
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
(cherry picked from commit dbcbe87d52)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-07 17:25:37 +02:00
Paweł Gronowski
8fa4bd5e0d Merge pull request #51121 from crazy-max/28.x_ci-caches-fixes
[28.x] ci: update gha cache attributes
2025-10-07 13:31:15 +02:00
CrazyMax
e59129b9cc ci: update gha cache attributes
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-10-07 12:41:00 +02:00
Paweł Gronowski
28d9ed5878 Merge pull request #51116 from austinvazquez/cherry-pick-fix-go-validation-to-28.x
[28.x] Rework Go mod tidy/vendor checks
2025-10-07 08:43:48 +02:00
Austin Vazquez
adcea7bdc9 Rework Go mod tidy/vendor checks
This change reworks the Go mod tidy/vendor checks to run for all tracked Go modules by the project and fail for any uncommitted changes.

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
(cherry picked from commit f6e1bf2808)
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-06 19:19:23 -05:00
Austin Vazquez
bab04642ff Add existence check for go.mod and go.sum files
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
(cherry picked from commit 0ad35e3ef0)
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-06 19:11:11 -05:00
Austin Vazquez
7841b1c65b Merge pull request #51110 from thaJeztah/28.x_backport_deprecate_plugin_dockerversion
[28.x backport] api/types/plugin: deprecate Config.DockerVersion field
2025-10-06 08:04:17 -07:00
Sebastiaan van Stijn
1dcce6800f api/types/plugin: deprecate Config.DockerVersion field
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c4fda95bea)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-06 14:22:41 +02:00
Sebastiaan van Stijn
b67c30f946 Merge pull request #51105 from thaJeztah/28.x_backport_deprecate_legacy_inspect_fields
[28.x backport] api/types/image: InspectResponse: deprecate Parent, DockerVersion
2025-10-06 11:43:29 +02:00
Sebastiaan van Stijn
3388108f9a api/types/image: InspectResponse: deprecate Parent, DockerVersion
The image inspect response has various fields that were deprecated as
part of the legacy builder, or Dockerfile syntax;

- The `Parent` field is only used for the legacy builder, and only set for
  images that are built locally (i.e., not persisted when pulling an image).
- The `DockerVersion` field is only set when building images with the legacy
  builder, and empty in most cases.

This patch deprecates the fields in the `InspectResponse` go struct, as
these fields will no longer be set in future once the legacy builder is
removed (`Parent`, `DockerVersion`). The legacy builder's deprecation in
[cli@4d8e457] / [cli@fd22746] (docker 23.0, API v1.42), however the related
API fields were kept so that information of legacy images would not be
discarded.

The API continues to return these fields if set, allowing the client to
print the fields for informational purposes when printing the raw response,
but these fields should be considered "transitional", and not be depended
on; deprecating the fields helps raise awareness.

[cli@4d8e457]: 4d8e45782b
[cli@fd22746]: fd2274692f

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit bd8a99b400)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-05 23:06:38 +02:00
Austin Vazquez
5c2c3c2ae1 Merge pull request #51091 from austinvazquez/add-vendor-sum-to-28.x
[28.x] Add back vendor.sum
2025-10-03 13:27:18 -07:00
Austin Vazquez
e468481ff0 Add back vendor.sum
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-02 17:21:18 -05:00
Sebastiaan van Stijn
cd048300a4 Merge pull request #51075 from vvoland/51074-28.x
[28.x backport] vendor: github.com/moby/buildkit v0.25.0
2025-10-01 17:26:18 +02:00
Jonathan A. Sternberg
e29d6be7a5 vendor: github.com/moby/buildkit v0.25.0
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 3f3bbe4430)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-01 11:53:21 +02:00
Sebastiaan van Stijn
9b4369035b Merge pull request #51069 from thaJeztah/28.x_backport_docs_rm_deprecated_virtualsize
[28.x backport] api: swagger: remove VirtualSize fields for API > v1.43
2025-09-30 14:56:00 +02:00
Sebastiaan van Stijn
4f3572596b api: swagger: remove VirtualSize fields for API > v1.43
The `VirtualSize` field was deprecated in [moby@1261fe6], and omitted / removed
in API v1.44 in [moby@913b0f5]. We should not document the field as part of
those API versions as it no longer exists for those.

[moby@1261fe6]: 1261fe69a3
[moby@913b0f5]: 913b0f51ca

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 51cbd2ed16)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-30 13:19:32 +02:00
Sebastiaan van Stijn
79f310d4bc Merge pull request #51067 from austinvazquez/cherry-pick-deprecate-kernel-memocy-tcp-to-28.x
[28.x backport] api: deprecate `KernelMemoryTCP` support
2025-09-30 10:31:27 +02:00
Austin Vazquez
deb4bbbfe0 api: deprecate KernelMemoryTCP support
Starting with kernel v6.12, kernel memory TCP accounting is deprecated for cgroups v1.
Note: kernel memory TCP accounting is not supported by cgroups v2.

See d046ff46ee

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
(cherry picked from commit fb2f8115c8)
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-30 10:19:06 +02:00
Sebastiaan van Stijn
423a7fd6af Merge pull request #51064 from thaJeztah/28.x_backport_fix_epcnt_warning
[28.x backport] Eliminate warning about endpoint count store delete
2025-09-29 17:21:26 +02:00
Rob Murray
fbf2fe8b7d Eliminate warning about endpoint count store delete
Commit 380ded6 restored a now-unused endpoint count to the
store, so that when the daemon is downgraded it exists for
the old code to find.

But, on network deletion, the endpoint count was not loaded
from the store - so the delete code saw the wrong "index",
and logged a warning before deleting it anyway.

Use DeleteObject instead of DeleteObjectAtomic, so the old
index isn't checked.

Signed-off-by: Rob Murray <rob.murray@docker.com>
(cherry picked from commit 94bcf89412)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-29 15:15:55 +02:00
Austin Vazquez
252a1ebe7e Merge pull request #51061 from thaJeztah/28.x_backport_rm_email_example
[28.x backport] api/docs: remove email field from example auth
2025-09-29 05:30:22 -07:00
Sebastiaan van Stijn
2c15eb6617 api/docs: remove email field from example auth
This field was no longer used since Docker 1.11 (API version 1.23)
through [moby@aee260d] and [engine-api@9a9e468] but kept and deprecated
in [engine-api@167efc7], however the docs still used it in an example.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 08d014cac8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-29 11:30:57 +02:00
Sebastiaan van Stijn
f984f7218f Merge pull request #51052 from vvoland/51051-28.x
[28.x backport] api/checkpoint: Don't return null if no checkpoints
2025-09-27 00:50:13 +02:00
Paweł Gronowski
fd10938136 api/checkpoint: Don't return null if no checkpoints
This fixes a bug where no checkpoints would produce a `null` response
instead of an empty array:

```
$ docker run -d --name foo nginx:alpine
17fbeff7185733f101c38cb8208359dd0ef141116a1345da2d3c3f58c11f3e14

$ curl --unix-socket /var/run/docker.sock http://local/containers/foo/checkpoints
null
```

With this patch, this becomes:
```
$ curl --unix-socket /var/run/docker.sock http://local/containers/foo/checkpoints
[]
```

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 646e068cf1)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-26 16:47:16 +02:00
Paweł Gronowski
73f8d82c4b Merge pull request #51038 from thaJeztah/28.x_backport_api_rm_BridgeNfIptables
[28.x backport] api: docs: remove deprecated BridgeNfIptables, BridgeNfIp6tables
2025-09-25 11:25:46 +00:00
Sebastiaan van Stijn
1096e39142 api: docs: remove deprecated BridgeNfIptables, BridgeNfIp6tables
The `BridgeNfIptables` and `BridgeNfIp6tables` were removed in API v1.50
in commit 6505d3877c, and only returned in
lower API versions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0fb46d08ad)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-25 12:38:26 +02:00
Paweł Gronowski
dc504e1e68 Merge pull request #51039 from thaJeztah/28.x_backport_gha-validate-only
[28.x backport] gha: Add conditional skip for jobs with 'ci/validate-only' label
2025-09-25 10:14:40 +02:00
Paweł Gronowski
9fa8529070 gha: Add conditional skip for jobs with 'ci/validate-only' label
This change adds conditional logic to skip build and test jobs when a
pull request is labeled with 'ci/validate-only'.

The `govulncheck` job in the CI workflow is intentionally excluded from
this conditional logic, ensuring security vulnerability checks always
run regardless of the label.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit f0c069ffc9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-25 00:05:16 +02:00
Paweł Gronowski
d21856f25d Merge pull request #51032 from vvoland/51029-28.x
[28.x] vendor: github.com/moby/buildkit v0.25.0-rc1
2025-09-24 18:26:09 +02:00
Austin Vazquez
b7496d9ec0 Merge pull request #51035 from vvoland/51009-28.x
[28.x backport] ipams: Re-enable legacy remote plugins support
2025-09-24 08:17:12 -07:00
Paweł Gronowski
3aa032e1e8 Merge pull request #51034 from vvoland/50910-28.x
[28.x backport] api/docs: remove temporary "full" example for image config
2025-09-24 17:04:15 +02:00
Tonis Tiigi
80ac399595 hack: use custom ref for buildkit tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit e8d3609031)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-24 16:26:15 +02:00
Paweł Gronowski
22e0cb2d64 vendor: github.com/moby/buildkit v0.25.0-rc1
full diff: https://github.com/moby/buildkit/compare/v0.24.0...v0.25.0-rc1

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-24 16:26:13 +02:00
Olli Janatuinen
1b0ba3b217 ipams: Re-enable legacy remote plugins support
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
(cherry picked from commit aa492314a1)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-24 13:27:16 +02:00
Sebastiaan van Stijn
6d311b44e4 api/docs: remove temporary "full" example for image config (v1.50, v1.51)
This example was added in 5e0e34fafd so that
the deprecated fields could be omitted from the example. Those fields were
removed from the swagger in 4dc961d0e9, but
the temporary example was not removed.

This patch removes the example, in favor of the per-field examples, which
were already in place.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0fe1af95f3)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-24 13:24:23 +02:00
Sebastiaan van Stijn
608fdeb216 api/swagger: remove temporary "full" example for image config
This example was added in 5e0e34fafd so that
the deprecated fields could be omitted from the example. Those fields were
removed from the swagger in 4dc961d0e9, but
the temporary example was not removed.

This patch removes the example, in favor of the per-field examples, which
were already in place.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7bfbb6e8ca)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-24 13:24:14 +02:00
Austin Vazquez
46dcd7f33e Merge pull request #50938 from vvoland/50936-28.x
[28.x backport] Dockerfile.windows: remove deprecated 7Zip4Powershell
2025-09-09 09:48:30 -07:00
Paweł Gronowski
81da1cfdb2 Dockerfile.windows: remove deprecated 7Zip4Powershell
`tar` utility is included in Windows 10 (17063+) and Windows Server
2019+ so we can use it directly.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 8c8324b37f)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-09 17:35:25 +02:00
Paweł Gronowski
249d679a6b Merge pull request #50890 from vvoland/50889-28.x
[28.x backport] update to go1.24.7
2025-09-03 22:28:49 +02:00
Paweł Gronowski
d664cfe139 update to go1.24.7
This includes 1 security fix:

- net/http: CrossOriginProtection bypass patterns are over-broad

    When passing patterns to CrossOriginProtection.AddInsecureBypassPattern,
    requests that would have redirected to those patterns (e.g. without a trailing
    slash) were also exempted, which might be unexpected.

    Thanks to Marco Gazerro for reporting this issue.

    This is CVE-2025-47910 and Go issue https://go.dev/issue/75054.

View the release notes for more information:
https://go.dev/doc/devel/release#go1.24.7

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 30406d42e3)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-03 20:34:21 +02:00
Paweł Gronowski
b384cd2a45 Merge pull request #50888 from vvoland/50885-28.x
[28.x backport] vendor: update buildkit to v0.24.0
2025-09-03 20:30:05 +02:00
Kevin Alvarez
c1ce88e7f8 vendor: update buildkit to v0.24.0
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit d47b0db4f9)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-03 18:43:00 +02:00
Austin Vazquez
4a34e8e9f6 Merge pull request #50875 from vvoland/50867-28.x
[28.x backport] c8d/history: Fix non-native platforms
2025-09-02 07:16:20 -07:00
Paweł Gronowski
cfa70d073e gha/arm64: Setup qemu
Make it possible to build non-native images like the other
test-integration workflows

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 8031b077bc)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-02 15:05:26 +02:00
Paweł Gronowski
d70382e442 integration/internal: Print Buildkit logs
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit ce338dec81)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-02 15:05:26 +02:00
Paweł Gronowski
687b206c6b c8d/history: Fix non-native platforms
When building a non-native platform, it's not unpacked by default.
History tries to read the disk usage of all the layer and it doesn't
handle missing snapshots gracefully.

This patch fixes this.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 27fca93b65)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-02 15:05:26 +02:00
Paweł Gronowski
e4224f86c0 integration/internal: Handle Buildkit in GetImageIDFromBody
BuildKit emits some additional events during build and they are not
`build.Result` so don't fail if we encounter one.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit ad830a47af)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-02 14:47:09 +02:00
Albin Kerouanton
5d5332b00c Merge pull request #50871 from vvoland/50870-28.x
[28.x backport] graphdriver/windows: Potential fix for access denied
2025-09-02 11:56:42 +02:00
Paweł Gronowski
87622a0ee5 graphdriver/windows: Potential fix for access denied
Use `winio.RunWithPrivileges` to get the privileges.
It's better because it also locks the Go runtime thread so if the Go
scheduler decides to run this code on a different thread, it will still
have the expected privileges.

A naive attempt at fixing an error experienced by Docker Desktop user
when using Windows containers:

```
failed to register layer: re-exec error: exit status 1: output: hcsshim::ProcessUtilityVMImage \\?\C:\ProgramData\Docker\windowsfilter\<hash1>\UtilityVM: Access is denied.
failed to register layer: re-exec error: exit status 1: output: hcsshim::ProcessBaseLayer \\?\C:\ProgramData\Docker\windowsfilter\<hash2>: Access is denied.
failed to register layer: re-exec error: exit status 1: output: hcsshim::ProcessBaseLayer \\?\C:\ProgramData\Docker\windowsfilter\<hash3>: Access is denied.
```

Unfortunately I can't reproduce the issue on a Windows VM, but this
definitely won't hurt.

At least, I verified that the daemon still works on Windows.

Inspired by: https://github.com/containerd/containerd/issues/8206

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit f66f555ad4)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-02 10:32:09 +02:00
Sebastiaan van Stijn
ffb621aade Merge pull request #50868 from vvoland/50390-28.x
[28.x backport] migrate test api images history integration cli test to integration test
2025-09-01 18:53:09 +02:00
Sebastiaan van Stijn
ac93e0ffb9 Merge pull request #50865 from crazy-max/28.x_pick_buildkit-0.24.0-rc2
[28.x backport] vendor: github.com/moby/buildkit v0.24.0-rc2
2025-09-01 18:16:33 +02:00
Abubacarr Ceesay
1c7c645702 implement test api images history integration test on dedicated file
Signed-off-by: Abubacarr Ceesay <abubacarr671@gmail.com>
(cherry picked from commit f6b3b257c8)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-01 16:11:59 +02:00
Abubacarr Ceesay
43a614bec0 remove test api images history integration cli test suite
Signed-off-by: Abubacarr Ceesay <abubacarr671@gmail.com>
(cherry picked from commit 669163c416)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-01 16:11:58 +02:00
Abubacarr Ceesay
a8914649d8 migrate test api images history integration cli test to integration test
Signed-off-by: Abubacarr Ceesay <abubacarr671@gmail.com>
(cherry picked from commit 04dbcddd6a)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-01 16:11:57 +02:00
CrazyMax
18e4a056bb hack: temporarily use custom buildkit ref for testing
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-09-01 14:55:33 +02:00
Tonis Tiigi
b6427d938e vendor: update buildkit to v0.24.0-rc2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-09-01 14:55:33 +02:00
Paweł Gronowski
ee159311c4 Merge pull request #50839 from akerouanton/28.x-deprecate-NetworkSettingsBase
[28.x] deprecate NetworkSettingsBase, DefaultNetworkSettings
2025-08-29 19:38:32 +02:00
Albin Kerouanton
660b67be5e api/types: update deprecation notice on NetworkSettingsBase
container.NetworkSettingsBase is deprecated in v28.4, and scheduled for
removal in v29. However, it contains three fields that aren't deprecated
and that will be moved to NetworkSettings.

Update the deprecation notice on NetworkSettingsBase to advise users
to access NetworkSettingsBase's fields through NetworkSettings.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-08-29 18:31:27 +02:00
Albin Kerouanton
eb7be20774 api/t/ctr: deprecate DefaultNetworkSettings
This struct is only used to report the networking state for the default
bridge network when the container is connected to it.

It was deprecated in v1.09 (API v1.21), and scheduled for removal in
v1.11. Unfortunately, the deprecation warning was wrongly formatted in
the Go code. However, deprecation warnings are already present in
swagger.yaml, so don't touch it.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit b7c597ec35)
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-08-29 18:31:05 +02:00
Albin Kerouanton
01b27f6056 testutil/daemon: remove unused FindContainerIP
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit d0de293513)
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-08-29 18:30:57 +02:00
Albin Kerouanton
65a1687e3d api/t/ctr: deprecate NetworkSettingsBase
Most fields in NetworkSettingsBase are deprecated, so deprecate the
whole struct. The few fields which aren't deprecated will move to the
NetworkSettings struct in v29.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit 80bb864fd6)
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-08-29 18:30:56 +02:00
Albin Kerouanton
0e5ff488de api/t/ctr: deprecate NetworkSettingsBase.Bridge
This field provides little value as it's only set when the daemon is
started with --bridge flag specified, and the inspected container is
connected to the default bridge network.

Unfortunately, there's no equivalent field in NetworkSettings.Networks.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit 16dc39136c)
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-08-29 17:19:36 +02:00
Sebastiaan van Stijn
02b4a1a3de Merge pull request #50837 from thaJeztah/28.x_backport_fix-containerd-prune-events
[28.x backport] Fix image prune events for containerd backend
2025-08-28 15:48:22 +02:00
Derek McGowan
a36d9d6276 Fix image prune events for containerd backend
Ensure events for containerd backend are properly sent when deleted via
image prune. Fix prune output to only show deleted images rather than
the deletion of each blob.

Signed-off-by: Derek McGowan <derek@mcg.dev>
(cherry picked from commit da2b1a2930)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-28 14:37:22 +02:00
Austin Vazquez
8fd7525658 Merge pull request #50781 from thaJeztah/28.x_backport_bump_buildkit_v0.24
[28.x backport] vendor: github.com/moby/buildkit v0.24.0-rc1
2025-08-27 16:50:18 -07:00
Sebastiaan van Stijn
b13b91c54b vendor: github.com/moby/buildkit v0.24.0-rc1
full diff: https://github.com/moby/buildkit/compare/v0.23.2...v0.24.0-rc1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 229a29649f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-28 00:19:21 +02:00
Sebastiaan van Stijn
314a8f8f0b Merge pull request #50829 from robmry/backport-28.x/unmap_endpoint_addresses
[28.x backport] Unmap IPv4 addresses loaded from store
2025-08-27 22:01:22 +02:00
Rob Murray
31f405932a Unmap IPv4 addresses loaded from store
When a endpoint's net.IPNet is loaded from store and converted
to a netip.Addr, unmap it so that iptables rules don't contain
IPv4-mapped IPv6 addresses.

Signed-off-by: Rob Murray <rob.murray@docker.com>
(cherry picked from commit 071e6472db)
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-08-27 19:48:31 +01:00
Sebastiaan van Stijn
4c8a437c78 Merge pull request #50802 from thaJeztah/28.x_backport_move_logdriver_interfaces
[28.x backport] Move swarm runtime plugin spec to swarm types
2025-08-27 13:40:47 +02:00
Sebastiaan van Stijn
1ab19b12f5 Merge pull request #50822 from thaJeztah/28.x_backport_client_winio_dialpipe
[28.x backport] client: use go-winio.DialPipe directly
2025-08-27 12:56:25 +02:00
Sebastiaan van Stijn
5d385475ee Merge pull request #50821 from thaJeztah/28.x_backport_inspect_no_shadow
[28.x backport] daemon: Daemon.getInspectData: inline struct-literals
2025-08-27 12:55:41 +02:00
Sebastiaan van Stijn
74e4ea4ccc Merge pull request #50820 from thaJeztah/28.x_fix_plugin_fixture
[28.x] testutil/fixtures/plugin: makePluginBundle: fix invalid spec
2025-08-27 12:20:49 +02:00
Sebastiaan van Stijn
ffe9175177 client: use go-winio.DialPipe directly
The go-connections package implementation is only a shallow wrapper
around go-winio for named pipes; use the go-winio implementation
directly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit accbfde61e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-27 11:03:10 +02:00
Sebastiaan van Stijn
7ea634f7e0 daemon: Daemon.getInspectData: inline struct-literals
Also rename the "container" argument, which shadowed an import.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 44972d7427)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-27 10:50:58 +02:00
Sebastiaan van Stijn
c2dca55d7d testutil/fixtures/plugin: makePluginBundle: fix invalid spec
The fixture was using an invalid formatted Capability, which wasn't
detected in the old API code, but fails with the API module, for example:

    === RUN   TestPluginsWithRuntimes
        plugin_test.go:269: assertion failed: error is not nil: json: error calling MarshalText for type plugin.CapabilityID: capability "docker.dummy/1.0" cannot contain a dot
    --- FAIL: TestPluginsWithRuntimes (0.63s)
    === RUN   TestPluginBackCompatMediaTypes
        plugin_test.go:331: assertion failed: error is not nil: json: error calling MarshalText for type plugin.CapabilityID: capability "docker.dummy/1.0" cannot contain a dot
    --- FAIL: TestPluginBackCompatMediaTypes (0.11s)
    FAIL

This patch applies the same changes as ee560a3b23
in the master branch.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-27 10:32:59 +02:00
Sebastiaan van Stijn
ebbaaf1a17 [28.x] api: swarm: move RuntimeSpec, RuntimePrivilege back
Move these types back to their old location, but alias in the
new location so that any user of the old types would not require
to update.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-27 09:09:31 +02:00
Derek McGowan
ad4646255d Move swarm runtime plugin spec to swarm types
- Move swarm runtime plugin spec to swarm types
- Move swarm runtime plugin storage type to internal

Signed-off-by: Derek McGowan <derek@mcg.dev>
(cherry picked from commit 86190e7366)
(cherry picked from commit ee24dcec3d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-25 17:23:30 +02:00
Paweł Gronowski
2fa44c2485 Merge pull request #50797 from thaJeztah/28.x_backport_fix_email_deprecation
[28.x backport] api/types/registry: update deprecation comment for AuthConfig.Email
2025-08-25 13:27:59 +02:00
Sebastiaan van Stijn
fdf63a4471 api/docs: update description for AuthConfig.Email field
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d867f9f0f1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-23 00:23:20 +02:00
Sebastiaan van Stijn
2ca61b29d8 api/types/registry: update deprecation comment for AuthConfig.Email
The Email field was originally used to create a new Docker Hub account
through the `docker login` command. The `docker login` command could be
used both to log in to an existing account (providing only username and
password), or to create a new account (providing desired username and
password, and an e-mail address to use for the new account).

This functionality was confusing, because it was implemented when Docker
Hub was the only registry, but the same functionality could not be used
for other registries. This functionality was removed in Docker 1.11 (API
version 1.23) through [moby@aee260d], which also removed the Email field
([engine-api@9a9e468]) as it was no longer used.

However, this caused issues when using a new CLI connecting with an old
daemon, as the field would no longer be serialized, and the deprecation
may not yet be picked up by custom registries, so [engine-api@167efc7]
added the field back, deprecated it, and added an "omitempty". There
was no official "deprecated" format yet at the time, so let's make sure
the deprecation follows the proper format to make sure it gets noticed.

[moby@aee260d]: aee260d4eb
[engine-api@9a9e468]: 9a9e468f50
[engine-api@167efc7]: 167efc72bb

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6cfff7e880)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-23 00:22:48 +02:00
Austin Vazquez
78470bcd4d Merge pull request #50793 from thaJeztah/28.x_backport_bump_deps
[28.x backport] vendor: golang.org/x/sync v0.16.0, go.etcd.io/bbolt v1.4.3
2025-08-22 13:26:13 -07:00
Sebastiaan van Stijn
8ae706833d vendor: go.etcd.io/bbolt v1.4.3
Fix potential data corruption in (*Tx)WriteTo if underlying db file
is overwritten

full diff: https://github.com/etcd-io/bbolt/compare/v1.4.2...v1.4.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 15f92925f0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-22 14:20:42 +02:00
Sebastiaan van Stijn
cc6af47b61 vendor: golang.org/x/sync v0.16.0
full diff: https://github.com/golang/sync/compare/v0.14.0...v0.16.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e8d0aba254)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-22 14:20:18 +02:00
Sebastiaan van Stijn
80947b5724 Merge pull request #50777 from thaJeztah/28.x_backport_remove_TestEventsBackwardsCompatible
[28.x backport] integration/system: remove TestEventsBackwardsCompatible, add TestEventsNonBlocking
2025-08-21 16:43:30 +02:00
Austin Vazquez
13f2be7b1a Merge pull request #50780 from thaJeztah/28.x_backport_bump_deps
[28.x backport] update dependencies for buildkit
2025-08-20 15:33:09 -07:00
Sebastiaan van Stijn
553c3b8c9f vendor: go.etcd.io/bbolt v1.4.2
- Fix the compilation issue on aix, android and solaris due to wrong use of maxMapSize
- Add protection on meta page when it's being written
- Correct the incorrect usage of debug method
- Add clarification on the option InitialMmapSize
- Fix the crash when writing huge values

full diff: https://github.com/etcd-io/bbolt/compare/v1.4.0...v1.4.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a2aa7be724)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-20 22:15:23 +02:00
Sebastiaan van Stijn
7d7edf46a6 go.mod: github.com/containerd/containerd/v2 v2.1.4
full diff: https://github.com/containerd/containerd/compare/v2.1.3...v2.1.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3b14c5488f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-20 22:14:47 +02:00
Sebastiaan van Stijn
993eae423e go.mod: dario.cat/mergo v1.0.2
drops gopkg.in/yaml.v3 as dependency

full diff: https://github.com/darccio/mergo/compare/v1.0.1...v1.0.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 259eb259bc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-20 22:14:47 +02:00
Sebastiaan van Stijn
2c93d2f909 go.mod: github.com/docker/go-events v0.0.0-20250114142523-c867878c5e32
full diff: e31b211e4f...c867878c5e

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d8b622b315)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-20 22:14:47 +02:00
Sebastiaan van Stijn
6305a44e58 go.mod: github.com/fernet/fernet-go v0.0.0-20240119011108-303da6aec611
Update to the latest version, which is now a module;
full diff: 9f70042a33...303da6aec6

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8e63b55146)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-20 22:14:46 +02:00
Paweł Gronowski
03a4cd8d9a vendor: code.cloudfoundry.org/clock v1.37.0
full diff: https://github.com/cloudfoundry/clock/compare/v1.1.0...v1.37.0

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 03a662b80e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-20 22:14:15 +02:00
Sebastiaan van Stijn
687cd8ebae integration/system: remove TestEventsBackwardsCompatible
This test was added in 72f1881df1, which
introduced a dedicated `events.Message` struct for the events endpoints.
Before that change, events would produce a generic `JSONMessage`, and
the test is to verify that an `events.Message` could be successfully
unmarshalled to a `JSONMessage`.

The change above was part of docker 1.10 (API version 1.22), which we
no longer support, so we can remove this test.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit eac4c43aaa)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-20 18:37:18 +02:00
Sebastiaan van Stijn
95c3340e75 integration/system: add TestEventsNonBlocking
This adds the "non-blocking" part of the TestEventsBackwardsCompatible
as a separate test, as it's not related to the backward-compatibility
part of that test.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b0d9a90f45)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-20 18:35:47 +02:00
Austin Vazquez
436c33fcf3 Merge pull request #50768 from austinvazquez/deprecate-disk-usage-structs-in-api
[28.x] api/types: deprecate disk usage types for build cache, container, ima…
2025-08-19 09:42:45 -07:00
Austin Vazquez
e364b6c466 ci: add golangci-lint configuration to ignore deprecated api type usage in daemon
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-19 09:31:48 -05:00
Austin Vazquez
9396c31e13 api/types: deprecate disk usage types for build cache, container, images, and volumes
These types are only used internal to the daemon and will be removed from the api in the next release.

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-19 07:37:55 -05:00
Sebastiaan van Stijn
caed16fa09 Merge pull request #50762 from thaJeztah/28.x_deprecate_jsonmessage_fields
[28.x] pkg/jsonmessage: JSONMessage: deprecate From, Time, and TimeNano fields
2025-08-19 14:31:03 +02:00
Sebastiaan van Stijn
bcbccc6eec pkg/jsonmessage: JSONMessage: deprecate From, Time, and TimeNano fields
On API version v1.22 and older, the `JSONMessage` was used to produce the
`/events` response. However, commit 72f1881df1
introduced an `events.Message` type that replaced the use of `JSONMessage`
for that purpose.

The `JSONMessage` is no longer used to unmarshal these messages, and users
of this package should not depend on these fields, and use the `events.Message`
type instead for unmarshaling the `/events` response.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-18 20:06:06 +02:00
Sebastiaan van Stijn
a8682c5d39 Merge pull request #50742 from thaJeztah/28.x_backport_api_network_errors
[28.x backport] Add multierror function to api network
2025-08-15 00:56:37 +02:00
Austin Vazquez
fc31d47bee Merge pull request #50737 from thaJeztah/28.x_backport_client_remove_getDockerOS
[28.x backport] client: remove getDockerOS utility in favor of "Ostype" header
2025-08-14 13:34:52 -07:00
Derek McGowan
5a0d62cab0 Add multierror function to api network
Preserve error formatting without importing internal package from the
root package.

Signed-off-by: Derek McGowan <derek@mcg.dev>
(cherry picked from commit 374fa24a53)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-14 22:00:03 +02:00
Austin Vazquez
30efb73008 Merge pull request #50738 from thaJeztah/28.x_backport_fix-push-wo-auth
[28.x backport] daemon/router/image: initialize default authConfig
2025-08-14 12:58:43 -07:00
Tiago Teixeira
8a89fe5c19 daemon/router/image: initialize default authConfig
Signed-off-by: Tiago Teixeira <tiago.teixeira@ecorobotix.com>
(cherry picked from commit 033ec8be44)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-14 18:53:27 +02:00
Sebastiaan van Stijn
e53cd07fcc client: remove getDockerOS utility in favor of "Ostype" header
This utility was added in 83b5729f64 to
replace httputils.ParseServerHeader, which was added to print a warning
on Windows in 126529c6d0. At the time, the
only available option to detect the daemon's OS was to parse the `Server`
header, which contained the version of Docker as well as the OS.

However, 7199522ea2 introduced an `OSType`
("Ostype") header that's included on all responses, and a later commit
e9dac5ef5e changed that to also be included
when producing an error for unsupported API versions.

Note that the casing in the midddleware was changed from `OSType` to
`Ostype` (normalized form) in 76a5ca1d4d,
but headers are case-insensitive, and `header.Get()` should handle either
case in the response.

In short; every API response contains an "Ostype" header, which already
contains the OS ("windows" or "linux") that doesn't require any parsing,
so let's put that header to use.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit fcf3ff1b2f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-14 18:49:40 +02:00
Austin Vazquez
1404cd6aa1 Merge pull request #50714 from vvoland/50679-28.x
[28.x backport] api: swagger: Tweak type of ForceUpdate to uint64
2025-08-13 08:30:45 -07:00
Hannes Ortmeier
cf0958f89b docs: api: Tweak type of ForceUpdate to uin64
Signed-off-by: Hannes Ortmeier <ortmeier.hannes@gmail.com>
(cherry picked from commit 185ae7ec2c)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-08-13 14:56:01 +02:00
Hannes Ortmeier
fd89baef7e api: swagger: Tweak type of ForceUpdate to uint64
Signed-off-by: Hannes Ortmeier <ortmeier.hannes@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c8173c5c1f)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-08-13 14:55:37 +02:00
Austin Vazquez
b3af0c840b Merge pull request #50707 from austinvazquez/cherry-pick-b25b421f97c1e04651210ced4e774268226d159a-to-28.x
[28.x] update to go1.24.6
2025-08-12 09:01:54 -07:00
Austin Vazquez
3fc876cd7b update to go1.24.6
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
(cherry picked from commit b25b421f97)
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-12 07:15:15 -05:00
Austin Vazquez
b61a1f7b30 Merge pull request #50696 from vvoland/50387-28.x
[28.x backport] integration/container: fix flaky TestRemoveContainerWithVolume
2025-08-12 05:09:17 -07:00
Austin Vazquez
3e7b60c12d Merge pull request #50695 from vvoland/50315-28.x
[28.x backport] Dockerfile: bump gotest.tools/gotestsum v1.12.3 (for go1.25)
2025-08-12 05:06:09 -07:00
Austin Vazquez
51d00bc794 Merge pull request #50698 from vvoland/50403-28.x
[28.x backport] integration/container: XFAIL flaky TestExecResize on Windows
2025-08-11 15:54:29 -07:00
Austin Vazquez
f8f6a7e108 Merge pull request #50700 from vvoland/50645-28.x
[28.x backport] Dockerfile: update containerd binary to v1.7.28
2025-08-11 15:42:58 -07:00
Austin Vazquez
96fb6e6a66 Merge pull request #50699 from vvoland/50644-28.x
[28.x backport] Dockerfile: update runc binary to v1.3.0
2025-08-11 15:09:30 -07:00
Austin Vazquez
cc86659203 Merge pull request #50697 from vvoland/50396-28.x
[28.x backport] integration-cli: fix flaky TestRestartStoppedContainer
2025-08-11 13:48:26 -07:00
Sebastiaan van Stijn
85aaa37c08 Dockerfile: update containerd binary to v1.7.28
- release notes: https://github.com/containerd/containerd/releases/tag/v1.7.28
- full diff: https://github.com/containerd/containerd/v1.7.27...v1.7.28

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8be1b2372a)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-08-11 22:06:58 +02:00
Sebastiaan van Stijn
16c7a35584 Dockerfile: update runc binary to v1.3.0
- release notes: https://github.com/opencontainers/runc/releases/tag/v1.3.0
- full diff: https://github.com/opencontainers/runc/compare/v1.2.6..v1.3.0

-----

This is the first release of the 1.3.z release branch of runc. It
contains a few minor fixes for issues found in 1.3.0-rc.2.

This is the first release of runc that will follow our new release and
support policy (see RELEASES.md for more details). This means that, as
of this release:

* As of this release, the runc 1.2.z release branch will now only
  receive security and "significant" bugfixes.
* Users are encouraged to plan migrating to runc 1.3.0 as soon as
  possible.
* Due to its particular situation, runc 1.1.z is officially no longer
  supported and will no longer receive any updates (not even for
  critical security issues). Users are urged (in the strongest possible
  terms) to upgrade to a supported version of runc.
* Barring any future changes to our release policy, users should expect
  a runc 1.4.0 release in late October 2025.

Fixed

* Removed pre-emptive "full access to cgroups" warning when calling
  `runc pause` or `runc unpause` as an unprivileged user without
  `--systemd-cgroups`. Now the warning is only emitted if an actual permission
  error was encountered.
* Several fixes to our CI, mainly related to AlmaLinux and CRIU.

Changed

* In runc 1.2, we changed our mount behaviour to correctly handle clearing
  flags. However, the error messages we returned did not provide as much
  information to users about what clearing flags were conflicting with locked
  mount flags. We now provide more diagnostic information if there is an error
  when in the fallback path to handle locked mount flags.
* Upgrade our CI to use golangci-lint v2.0.
* `runc version` information is now filled in using `//go:embed` rather than
  being set through `Makefile`. This allows `go install` or other non-`make`
  builds to contain the correct version information. Note that
  `make EXTRA_VERSION=...` still works.
* Remove `exclude` directives from our `go.mod` for broken `cilium/ebpf`
  versions. `v0.17.3` resolved the issue we had, and `exclude` directives are
  incompatible with `go install`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f5f984eec6)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-08-11 22:06:29 +02:00
Sebastiaan van Stijn
61443a72c2 integration/container: XFAIL flaky TestExecResize on Windows
This test is failing frequently (50%) on Windows;

    === FAIL: github.com/docker/docker/integration/container TestExecResize/success (0.01s)
        exec_test.go:144: assertion failed: error is not nil: Error response from daemon: NotFound: exec: '9c19c467436132df24d8b606b0c462b1110dacfbbd13b63e5b42579eda76d7fc' in task: '7d1f371218285a0c653ae77024a1ab3f5d61a5d097c651ddf7df97364fafb454' not found: not found

Let's keep the test, but log the failure and skip on Windows.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit fd8fec18cd)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-08-11 21:58:38 +02:00
Sebastiaan van Stijn
492b3c94cb integration-cli: fix flaky TestRestartStoppedContainer
This test was failing frequently on Windows, waiting for the state
of the container to be "running" after restarting, however, this
would race because the command of the container was very short-lived;

    === Failed
    === FAIL: github.com/docker/docker/integration-cli TestDockerCLIRestartSuite/TestRestartStoppedContainer (37.00s)
        docker_cli_restart_test.go:42: assertion failed: error is not nil: condition ""true" == "false"" not true in time (20s)

Ironically, that check was added in 48ccdd46ae
to make the test less flaky.

This patch takes the approach from TestRestartRunningContainer, which had
similar issues on Windows that were addressed in bae22d167c

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a327a9f341)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-08-11 21:58:01 +02:00
Sebastiaan van Stijn
d5b47b8fdf integration/container: fix flaky TestRemoveContainerWithVolume
This test depended on the container to die after running the `true` command,
but this condition failed frequently on Windows 2025.

    === Failed
    === FAIL: github.com/docker/docker/integration/container TestRemoveContainerWithVolume (32.68s)
        remove_test.go:61: timeout hit after 10s: waiting for container State.Status to be 'exited', currently 'running'

While this may be revealing an actual issue (and we should have a test for
that), it's irrelevant for this test, which;

- creates and starts a container with an anonymous volume
- verifies the anonymous volume was created
- removes the container
- verifies the anonymous volume was removed

We can force-remove the container to kill, and removed it; we probably
could've sufficed with "container create" (without starting), but it's
good to add extra coverage, in case running the container impacts whether
we're able to remove the volume.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d6c90dcb87)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-08-11 21:57:18 +02:00
Sebastiaan van Stijn
30663d3e86 Dockerfile: bump gotest.tools/gotestsum v1.12.3 (for go1.25)
full diff: https://github.com/gotestyourself/gotestsum/compare/v1.12.0...v1.12.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 4754c15e2b)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-08-11 21:39:16 +02:00
Sebastiaan van Stijn
40ba2f33d1 Merge pull request #50664 from vvoland/50662-28.x
[28.x backport] Fix download-frozen-image-v2
2025-08-08 01:29:38 +02:00
Paweł Gronowski
3a15e3ed23 download-frozen-image-v2: Use curl -L
Passing the Auth to the redirected location was fixed in curl 7.58:
https://curl.se/changes.html#7_58_0 so we no longer need the extra
handling and can just use `-L` to let curl handle redirects.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit b9b52d59b8)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-08-07 22:06:13 +02:00
Paweł Gronowski
ad243becbe download-frozen-image-v2: handle 307 responses without decimal
Correctly parse HTTP response that doesn't contain an HTTP version with a decimal place:

```
< HTTP/2 307
```

The previous version would only match strings like `HTTP/2.0 307`.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 359a881cea)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-08-07 22:06:10 +02:00
Paweł Gronowski
501f2eab7a Merge pull request #50581 from thaJeztah/28.x_backport_daemon_no_jsonstream
[28.x backport] Add separate const for daemon httputils to avoid jsonmessage import
2025-07-31 08:12:25 +00:00
Derek McGowan
648c74d243 Add separate const for daemon httputils to avoid jsonmessage import
Signed-off-by: Derek McGowan <derek@mcg.dev>
(cherry picked from commit 02fcde0c18)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-31 03:09:32 +02:00
Sebastiaan van Stijn
f4595bc7b7 Merge pull request #50562 from thaJeztah/28.x_rewrite_ToParamWithVersion
[28.x] api/types/filters: reimplement ToParamWithVersion
2025-07-29 14:51:16 +02:00
Sebastiaan van Stijn
eadee3e5b9 [28.x] api/types/filters: reimplement ToParamWithVersion
This function depended on the non-exported `Args.values` field.
With the migration of the API to a separate module, we will
alias that type, and remove the deprecated `ToParamWithVersion`
function.

This means that we cannot alias the function, and aliasing the
`Args` type means we can't access the non-exported field.

This patch reimplements `ToParamWithVersion` by unmarshaling
the JSON output of the current format, and re-marshaling it
to the legacy format.

This is not optimal, but this code-path would only be used
for API versions that are deprecated, and is not to be used
for any new code.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-29 12:59:57 +02:00
Sebastiaan van Stijn
c9c7964b7e Merge pull request #50545 from thaJeztah/28.x_fix_backend_types
[28.x backport] api/types/system: move DiskUsage, DiskUsageOptions to api/types/backend
2025-07-28 17:39:07 +02:00
Sebastiaan van Stijn
60e84e7350 api/types/system: move DiskUsage, DiskUsageOptions to api/types/backend
These types were introduced in f07242f6d7,
but while their description mentions it's the type used for the
response, it actually isn't, and it's used by the backend, but
ultimately marshaled to the "types.DiskUsage" struct;

7dc46c6e0c/daemon/server/router/system/system_routes.go (L254-L270)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 82c069c857)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 16:26:02 +02:00
Paweł Gronowski
fd06f0f345 Merge pull request #50513 from thaJeztah/28.x_backport_migrate_profiles
[28.x backport] profiles/apparmor, seccomp: migrate to separate module
2025-07-25 16:03:49 +02:00
Sebastiaan van Stijn
643fcf4465 Merge pull request #50514 from thaJeztah/28.x_test_updates
[28.x backport] remove, update obsolete tests
2025-07-25 15:42:57 +02:00
Sebastiaan van Stijn
7d6a75b342 runconfig: update fixtures for TestDecodeContainerConfig
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a401c0c046)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-25 13:57:16 +02:00
Sebastiaan van Stijn
596404f3aa integration-cli: remove tests for pre-docker 1.7 clients
The strslice.StrSlice type is a string-slice with a custom JSON Unmarshal
function to provide backward-compatibility with older API requests from
before docker 1.7 (see [moby@17d6f00] and [moby@ea4a067]), which used a
string instead of an array of strings for some fields (Cmd, Entrypoint).

We no longer support those API versions, and we no longer support pulling
v1 images that may contain such a config, so we can remove these tests that
validate the behavior as they're invalid API requests.

This;

- removes DockerAPISuite.TestPostContainerAPICreateWithStringOrSliceEntrypoint
- removes DockerAPISuite.TestPostContainersCreateWithStringOrSliceCmd
- removes DockerAPISuite.TestPostContainersCreateWithStringOrSliceCapAddDrop
- updates DockerAPISuite.TestContainerAPIPostCreateNull, which used an invalid example

[moby@17d6f00]: 17d6f00ec2
[moby@ea4a067]: ea4a06740b

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1378604cc3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-25 13:57:07 +02:00
Rob Murray
9fd8eaa95d Delete TestRunDNSOptionsBasedOnHostResolvConf
Because:
- it's the last thing outside 'daemon/' that uses libnetwork's
  resolvconf package
- there's better coverage of the host resolv.conf transformations
  in the resolvconf package's unit tests
- there are integration tests that don't modify the test host's
  resolv.conf file in 'integration/networking/resolvconf_test.go'

Signed-off-by: Rob Murray <rob.murray@docker.com>
(cherry picked from commit 3003c56c57)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-25 13:56:42 +02:00
Rob Murray
bea959c7b7 Merge pull request #50506 from robmry/backport-28.x/fix_firewalld_reload
[28.x backport] Fix firewalld reload for per-endpoint rules
2025-07-25 09:13:16 +01:00
Sebastiaan van Stijn
b2f03f45ea profiles/apparmor, seccomp: migrate to separate module
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a600da91f4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-25 10:09:00 +02:00
Andrey Epifanov
3e9ff78b94 bridge: Reapply endpoint iptables rules on firewalld reload
Signed-off-by: Andrey Epifanov <aepifanov@mirantis.com>
(cherry picked from commit 07393071ad)
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-07-24 17:30:46 +01:00
Rob Murray
29ed80aa86 bridge: Trigger firewalld reload during bridge integration tests
Make sure iptables rules are restored properly once firewalld
has deleted them.

Signed-off-by: Rob Murray <rob.murray@docker.com>
Signed-off-by: Andrey Epifanov <aepifanov@mirantis.com>
(cherry picked from commit 6d457d9695)
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-07-24 17:30:46 +01:00
Austin Vazquez
da489a11d4 Merge pull request #50478 from thaJeztah/28.x_backport_gha_bump_bk
[28.x backport] hack/buildkit-ref: temporarily bump BuildKit to head of v0.23 branch
2025-07-22 13:59:47 -07:00
Sebastiaan van Stijn
f173e45ae9 Merge pull request #50480 from austinvazquez/cherry-pick-ea29dffaa541289591aa44fa85d2a596ce860e16-to-28.x
[28.x backport] daemon/server: remove compatibility with API v1.4 auth-config on push
2025-07-22 20:02:48 +02:00
Sebastiaan van Stijn
e4b1f89996 daemon/server: remove compatibility with API v1.4 auth-config on push
Docker [API v1.4] and lower expected registry authentication to be sent in
the request body when pushing or pulling ("creating") images. [API v1.5]
(Docker v0.6.1) changed this to this to use a `X-Registry-Auth` header
instead.

This change was implemented in d04beb7f43,
which kept a fallback for clients using old (< v1.5) API versions which
would send authentication in the request body.

Given that we no longer support API versions older than v1.24, and clients
using API v1.5 would be over 12 Years old.

[API v1.4]: https://github.com/moby/moby/blob/v0.6.1/docs/sources/api/docker_remote_api_v1.4.rst#push-an-image-on-the-registry
[API v1.5]: https://github.com/moby/moby/blob/v0.6.2/docs/sources/api/docker_remote_api_v1.5.rst#push-an-image-on-the-registry

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ea29dffaa5)
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-07-22 08:31:32 -07:00
Sebastiaan van Stijn
0c9e14dcce hack/buildkit-ref: temporarily bump BuildKit to head of v0.23 branch
To skip some flaky tests on Windows

diff: https://github.com/moby/buildkit/compare/v0.23.2...dd2b4e18663c58ac3762d7b60b2c3301f71d5fa9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1cc42643ae)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-22 15:55:58 +02:00
Sebastiaan van Stijn
bf6d688157 Merge pull request #50471 from austinvazquez/cherry-pick-b1ce0c89f0214cc6711c5c34e714d8bda737c65a-to-28.x
[28.x backport] client: always send (empty) body on push
2025-07-22 14:20:35 +02:00
Sebastiaan van Stijn
4205776b85 client: always send (empty) body on push
Before ea29dffaa5, the image create endpoint
had a [fallback for very old client versions][1] that would send authentication
as body instead of through the `X-Registry-Auth` header.

However, the implementation of this fallback did not handle empty bodies,
resulting in an `io.EOF` error to be returned when trying to parse the
body as JSON.

In practice, this problem didn't happen when using the CLI, because even
if no authentication was present, `registry.EncodeAuthConfig()` (used by
the CLI to set the `X-Registry-Auth` header) would produce an empty JSON
document (`{}`), which would be encoded in base64 (`e30=`), so we would
never set an empty `X-Registry-Auth` (but other clients may have hit this
situation). That behavior was unexpected, because not all registries require
authentication, and omitting the `X-Registry-Auth` should be valid. We
also want to have more flexibility in authentication (and being able to
distinguish unauthenticated requests, so that we can fallback to
alternative paths).

Unfortunately, we can't change existing daemons, so must account for the
faulty fallback. Currently, omitting the `X-Registry-Auth` produces an
error, but we can avoid this by unconditionally sending a body, which
may be an empty JSON document (`{}`).

I explored possible options for this; we can either construct our own
empty JSON (`json.RawMessage("{}")`) to be explicit that we're sending
empty JSON, but [`encodeBody()`][2] is currently hard-coded to expect
JSON requests, and unconditionally calls [`encodeData`][3], which
encodes to JSON, so we may as well take advantage of `http.NoBody`,
which gets marshaled to an empty JSON document;
https://go.dev/play/p/QCw9dJ6LGQu

    package main

    import (
        "encoding/json"
        "fmt"
        "net/http"
    )

    func main() {
        body, _ := json.Marshal(http.NoBody)
        fmt.Println(string(body))
    }

Before this patch, a client omitting `X-Registry-Auth` (and no body)
would produce an error;

    docker pull -q busybox
    docker tag busybox 127.0.0.1:5001/myimage:latest

    docker run -d --name registry -p 127.0.0.1:5001:5000 registry:3
    docker push 127.0.0.1:5001/myimage:latest
    Error response from daemon: bad parameters and missing X-Registry-Auth: invalid X-Registry-Auth header: EOF

With this patch applied, no error is produced;

    docker pull -q busybox
    docker tag busybox 127.0.0.1:5001/myimage:latest

    docker run -d --name registry -p 127.0.0.1:5001:5000 registry:3
    docker push 127.0.0.1:5001/myimage:latest
    The push refers to repository [127.0.0.1:5001/myimage]
    189fdd150837: Pushed
    latest: digest: sha256:68a0d55a75c935e1101d16ded1c748babb7f96a9af43f7533ba83b87e2508b82 size: 610

[1]: 63fcf7d858/api/types/registry/authconfig_test.go (L109-L114)
[2]: 63fcf7d858/client/request.go (L67-L87)
[3]: 63fcf7d858/client/request.go (L296-L304)
[4]: ea29dffaa5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b1ce0c89f0)
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-07-21 15:59:17 -07:00
Paweł Gronowski
e77ff99ede Merge pull request #50354 from vvoland/50353-28.x
[28.x backport] Update to go1.24.5
2025-07-09 12:33:03 +02:00
Paweł Gronowski
6e3cf7f12b Merge pull request #50351 from vvoland/50179-28.x
[28.x backport] gha: update to windows 2022 / 2025
2025-07-09 10:14:10 +02:00
Paweł Gronowski
38c0abffce update to go1.24.5
- https://github.com/golang/go/issues?q=milestone%3AGo1.24.5+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.24.4...go1.24.5

This minor releases include 1 security fixes following the security policy:

- cmd/go: unexpected command execution in untrusted VCS repositories

    Various uses of the Go toolchain in untrusted VCS repositories can result in
    unexpected code execution. When using the Go toolchain in directories fetched
    using various VCS tools (such as directly cloning Git or Mercurial repositories)
    can cause the toolchain to execute unexpected commands, if said directory
    contains multiple VCS configuration metadata (such as a '.hg' directory in a Git
    repository). This is due to how the Go toolchain attempts to resolve which VCS
    is being used in order to embed build information in binaries and determine
    module versions.

    The toolchain will now abort attempting to resolve which VCS is being used if it
    detects multiple VCS configuration metadata in a module directory or nested VCS
    configuration metadata (such as a '.git' directoy in a parent directory and a
    '.hg' directory in a child directory). This will not prevent the toolchain from
    building modules, but will result in binaries omitting VCS related build
    information.

    If this behavior is expected by the user, the old behavior can be re-enabled by
    setting GODEBUG=allowmultiplevcs=1. This should only be done in trusted
    repositories.

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

    This is CVE-2025-4674 and https://go.dev/issue/74380.

View the release notes for more information:
https://go.dev/doc/devel/release#go1.24.5

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 0a047e825c)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-07-09 10:11:05 +02:00
Paweł Gronowski
3b7d703484 Merge pull request #50352 from vvoland/50347-28.x
[28.x backport] integration/networking: increase context timeout for attach
2025-07-08 19:01:29 +02:00
Sebastiaan van Stijn
d14a60fe24 Merge pull request #50348 from vvoland/50314-28.x
[28.x backport] gha: remove GO_VERSION build-arg from builds
2025-07-08 18:25:27 +02:00
Paweł Gronowski
da65c869b5 Merge pull request #50350 from vvoland/50333-28.x
[28.x backport] api: swagger: Tweak type of GwPriority to integer
2025-07-08 18:06:38 +02:00
Paweł Gronowski
76fbfe9953 Merge pull request #50349 from vvoland/50255-28.x
[28.x backport] dockerfile: update govulncheck to v1.1.4
2025-07-08 17:48:43 +02:00
Sebastiaan van Stijn
bfade89ec2 integration/networking: increase context timeout for attach
The TestNatNetworkICC and TestFlakyPortMappedHairpinWindows (TestPortMappedHairpinWindows)
tests were frequently failing on Windows with a context timeout;

    === FAIL: github.com/docker/docker/integration/networking TestNatNetworkICC/User_defined_nat_network (9.67s)
        nat_windows_test.go:62: assertion failed: error is not nil: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.51/containers/4357bd24c9b77b955ee961530d1f552ce099b3dcbeb396db599971b2396d8b08/start": context deadline exceeded
        panic.go:636: assertion failed: error is not nil: Error response from daemon: error while removing network: network mynat has active endpoints (name:"ctr2" id:"dc8d597dafef")

    === FAIL: github.com/docker/docker/integration/networking TestNatNetworkICC (18.34s)

    === FAIL: github.com/docker/docker/integration/networking TestFlakyPortMappedHairpinWindows (13.02s)
        nat_windows_test.go:110: assertion failed: error is not nil: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.51/containers/65207ae3d6953d85cd2123feac45af60b059842d570d4f897ea53c813cba3cb4/start": context deadline exceeded
        panic.go:636: assertion failed: error is not nil: Error response from daemon: error while removing network: network clientnet has active endpoints (name:"amazing_visvesvaraya" id:"18add58d415e")

These timeouts were set in c1ab6eda4b and
2df4391473, and were shared between Linux
and Windows; likely Windows is slower to start, so these timeouts to be
expected.

Let's increase the context timeout to give it a bit more time.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0ea28fede0)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-07-08 17:19:06 +02:00
Sebastiaan van Stijn
a818cfd87b gha: run windows 2025 on PRs, 2022 scheduled
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9316396db0)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-07-08 15:31:35 +02:00
Sebastiaan van Stijn
653777a522 gha: update to windows 2022 / 2025
The hosted Windows 2019 runners reach EOL on June 30;
https://github.com/actions/runner-images/issues/12045

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6f484d0d4c)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-07-08 15:31:28 +02:00
Niel Drummond
1ad3df4768 api: swagger: Tweak type of GwPriority to integer
Signed-off-by: Niel Drummond <niel@drummond.lu>
(cherry picked from commit 51d6687754)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-07-08 15:27:00 +02:00
Niel Drummond
6323db8e78 docs: api: Tweak type of GwPriority to integer
Signed-off-by: Niel Drummond <niel@drummond.lu>
(cherry picked from commit bfc0c7cff5)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-07-08 15:26:58 +02:00
CrazyMax
a3c8f7fa8c dockerfile: update govulncheck to v1.1.4
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
(cherry picked from commit fcf666f9b0)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-07-08 15:26:11 +02:00
Sebastiaan van Stijn
dfbba63a34 gha: remove GO_VERSION build-arg from builds
The same env-var is used for action/setup-go as for overriding
the default Go version in Dockerfiles, however action/setup-go
only accepts SemVer (e.g. 1.25.0-rc.1) whereas the official golang
image follows the Go project's versioning, which doesn't use
a SemVer-compatible format (go1.25rc1 / 1.25rc1).

Trying to use the same "GO_VERSION" value for both will therefore
fail.

As we're already updating the default version in the Dockerfile to
the version we want to use, let's remove the --build-arg, and use
the default that's set in the Dockerfile.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit fa4f3c979f)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-07-08 15:24:52 +02:00
Sebastiaan van Stijn
5beb93de84 Merge pull request #50309 from crazy-max/28.x_pick_buildkit-0.23.2
[28.x backport] vendor: update buildkit to v0.23.2
2025-07-02 15:31:29 +02:00
Tonis Tiigi
e17e96e3c5 vendor: update buildkit to v0.23.2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-07-02 11:48:40 +02:00
Sebastiaan van Stijn
e0183475e0 Merge pull request #50264 from vvoland/50263-28.x
[28.x backport] gha/bin-image: add major and minor version image tags
2025-06-25 14:47:55 +02:00
Paweł Gronowski
a2af8bdebd gha/bin-image: add major and minor version image tags
Adding image tags that follow the semver major and minor versions (e.g., `28`
and `28.3`) for the moby-bin images.

This makes it easier for users to reference the latest build within a
major or minor version series without having to know the exact
minor/patch version.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 38b98bcf68)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-24 23:32:35 +02:00
Paweł Gronowski
265f709647 Merge pull request #50247 from vvoland/50245-28.x
[28.x backport] docs: cut api docs for v1.51
2025-06-20 16:22:35 +00:00
Paweł Gronowski
b2a9318a1e docs: cut api docs for v1.51
Used by the upcoming 28.3.0 release

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit ef50844a0b)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-20 18:16:33 +02:00
Sebastiaan van Stijn
b3e2e22b2a Merge pull request #50244 from vvoland/50177-28.x
[28.x backport] gha: lower timeouts on "build" and "merge" steps
2025-06-20 17:37:41 +02:00
Sebastiaan van Stijn
c571cd8513 Merge pull request #50243 from vvoland/50238-28.x
[28.x backport] vendor: update buildkit to v0.23.1
2025-06-20 17:36:18 +02:00
Sebastiaan van Stijn
8c713c1af4 gha: lower timeouts on "build" and "merge" steps
We had some runs timeout after 120 minutes; expected duration is much
lower than that, so let's lower the timeout to make actions fail faster.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0a30b98447)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-20 16:29:08 +02:00
Paweł Gronowski
539c115023 Merge pull request #50240 from thaJeztah/28.x_backport_validate_mirrors
[28.x backport] daemon/config: Validate: add missing validation for registry mirrors and improve errors
2025-06-20 14:16:09 +00:00
CrazyMax
8e7ea470cf vendor: update buildkit to v0.23.1
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
(cherry picked from commit 5a02e7f4e3)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-20 16:05:04 +02:00
Jonathan A. Sternberg
222baf4ccb vendor: github.com/moby/buildkit v0.23.0
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
(cherry picked from commit e43968d7ed)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-20 16:04:30 +02:00
Paweł Gronowski
1627e828d7 Merge pull request #50241 from thaJeztah/28.x_backport_update_cgroups
[28.x backport] vendor: github.com/opencontainers/cgroups v0.0.3
2025-06-20 14:00:46 +00:00
Paweł Gronowski
4070ebda88 Merge pull request #50242 from thaJeztah/28.x_backport_fix_event_ordering
[28.x backport] daemon: containerStop: fix ordering of "stop" and "die" events
2025-06-20 13:38:31 +00:00
Paweł Gronowski
b613ac489e Merge pull request #50239 from vvoland/50237-28.x
[28.x backport] Update containerd to v2.1.3
2025-06-20 11:36:57 +00:00
Sebastiaan van Stijn
0e0ca09ddc daemon: containerStop: fix ordering of "stop" and "die" events
Commit 8e6cd44ce4 added synchronisation to
wait for the container's status to be updated in memory. However, since
952902efbc, a defer was used to produce
the container's "stop" event.

As a result of the sychronisation that was added, the "die" event would
now be produced before the "stop" event.

This patch moves the locking inside the defer to restore the previous
behavior.

Unfortunately the order of events is still not guaranteed, because events
are emited from multiple goroutines that don't have synchronisation between
them; this is something to look at for follow ups. This patch keeps the status
quo and should preserve the old behavior, which was "more" correct in most
cases.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 062082ec9b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-20 13:29:19 +02:00
Sebastiaan van Stijn
e62b0e2234 vendor: github.com/opencontainers/cgroups v0.0.3
- ConvertCPUSharesToCgroupV2Value: improve
- Add .github/dependabot.yml
- Remove annotations from Resources (fixes a regression introduced in v0.0.2)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a90da2edc3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-20 13:26:46 +02:00
Sebastiaan van Stijn
06ab9cd1ed daemon/config: Validate: add missing validation for registry mirrors
Validation of registry mirrors was performed during daemon startup,
but after the config-file was validated. As a result, the `--validate`
option would incorrectly print that the configuration was valid, but
the daemon would fail to start;

    echo '{"registry-mirrors":["example.com"]}' > my-config.json
    dockerd --config-file ./my-config.json --validate
    configuration OK

    dockerd --config-file ./my-config.json
    # ...
    failed to start daemon: invalid mirror: no scheme specified for "example.com": must use either 'https://' or 'http://'

With this patch applied, validation is also performed as part of the
daemon config validation;

    echo '{"registry-mirrors":["example.com"]}' > my-config.json
    dockerd --config-file ./my-config.json --validate
    unable to configure the Docker daemon with file ./my-config.json: merged configuration validation from file and command line flags failed: invalid mirror: no scheme specified for "example.com": must use either 'https://' or 'http://'

    # fix the invalid config
    echo '{"registry-mirrors":["https://example.com"]}' > my-config.json
    dockerd --config-file ./my-config.json --validate
    configuration OK

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1d8545d60c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-20 13:20:27 +02:00
Sebastiaan van Stijn
97aa4e8550 registry: ValidateMirror: improve validation for missing schemes
Before this patch, a missing scheme would sometimes produce a confusing
error message. If no scheme was specified at all, an empty "" would be
included in the message;

    echo '{"registry-mirrors":["example.com"]}' > my-config.json
    dockerd --config-file ./my-config.json
    # ...
    failed to start daemon: invalid mirror: unsupported scheme "" in "example.com"

If a scheme was missing, but a port was included, the hostname would be
printed as the scheme;

    echo '{"registry-mirrors":["example.com:8080"]}' > my-config.json
    dockerd --config-file ./my-config.json
    # ...
    failed to start daemon: invalid mirror: unsupported scheme "example.com" in "example.com:8080"

With this patch applied, the error messages are slightly more user-friendly;

    echo '{"registry-mirrors":["example.com"]}' > my-config.json
    dockerd --config-file ./my-config.json
    # ...
    failed to start daemon: invalid mirror: no scheme specified for "example.com": must use either 'https://' or 'http://'

    echo '{"registry-mirrors":["example.com:8080"]}' > my-config.json
    dockerd --config-file ./my-config.json
    # ...
    failed to start daemon: invalid mirror: no scheme specified for "example.com:8080": must use either 'https://' or 'http://'

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 307c18598d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-20 13:20:26 +02:00
Derek McGowan
e18a9c95b8 Update containerd to v2.1.3
Fixes various issues with pulling from registries

Signed-off-by: Derek McGowan <derek@mcg.dev>
(cherry picked from commit b466c35da1)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-20 11:28:31 +02:00
Sebastiaan van Stijn
b959bebdfc Merge pull request #50219 from thaJeztah/28.x_backport_deprecate_execconfig_detach
[28.x backport] api/types/container: deprecate ExecOptions.Detach
2025-06-18 23:03:00 +02:00
Sebastiaan van Stijn
02ade1a34c Merge pull request #50210 from thaJeztah/28.x_backport_pkg_idtools_deprecate
[28.x backport] pkg/idtools: deprecate IdentityMapping, Identity.Chown
2025-06-18 23:02:12 +02:00
Paweł Gronowski
106c4b0af6 Merge pull request #50211 from thaJeztah/28.x_backport_bump_swarmkit
[28.x backport] vendor: github.com/moby/swarmkit/v2 v2.0.0
2025-06-17 16:18:54 +00:00
Sebastiaan van Stijn
54d2eee6d6 Merge pull request #50217 from thaJeztah/28.x_backport_update-buildkit-v0.23.0-rc2
[28.x backport] vendor: update buildkit to v0.13.0-rc2
2025-06-17 15:10:47 +02:00
Sebastiaan van Stijn
09fef2b26e api/types/container: deprecate ExecOptions.Detach
This field was added in 5130fe5d38, which
added it for use as intermediate struct when parsing CLI flags (through
`runconfig.ParseExec`) in c786a8ee5e.

Commit 9d9dff3d0d rewrote the CLI to use
Cobra, and as part of this introduced a separate `execOptions` type in
`api/client/container`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0c182d4d57)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-17 13:10:50 +02:00
Tonis Tiigi
44c8cd2e8f vendor: update buildkit to v0.13.0-rc2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 1289519b03)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-17 11:36:27 +02:00
Cory Snider
78b6204f9e vendor: github.com/moby/swarmkit/v2 v2.0.0
Use the tagged version instead of the v2.0.0-20250613170222-a45be3cac15c
pseudo-version. The referenced commit has not changed.

Signed-off-by: Cory Snider <csnider@mirantis.com>
(cherry picked from commit c3ac979ecf)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-17 11:23:57 +02:00
Cory Snider
cf98237186 vendor: github.com/moby/swarmkit/v2 v2.0.0-20250613170222-a45be3cac15c
- fix task scheduler infinite loop

full diff: 8c19597365...a45be3cac1

Signed-off-by: Cory Snider <csnider@mirantis.com>
(cherry picked from commit 2d60b8eacd)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-16 17:53:26 +02:00
Sebastiaan van Stijn
fd96b01b0e pkg/idtools: deprecate IdentityMapping, Identity.Chown
The IdentityMapping and Identity types are still used internally, but
should be considered transitional.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b7ef527bdc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-16 17:40:11 +02:00
Paweł Gronowski
6a1fb46d48 Merge pull request #50169 from robmry/revert_overlay_refactoring
[28.x]: Revert overlay bug fixes / refactoring
2025-06-13 15:49:07 +00:00
Paweł Gronowski
9a9cade0df Merge pull request #50199 from vvoland/c8d-push-fixtag
c8d/push: Fix fallback single-manifest push not creating a tag
2025-06-13 13:42:50 +00:00
Paweł Gronowski
987b8a88a6 c8d/push: Extract shared push logic
Just a refactor of the previous commit to reduce duplication.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-13 14:51:18 +02:00
Sebastiaan van Stijn
e921abf618 Merge pull request #50198 from thaJeztah/bump_containerd
vendor: github.com/containerd/containerd/v2 v2.1.2
2025-06-13 14:39:07 +02:00
Paweł Gronowski
d9e7b86de4 c8d/push: Fix fallback single-manifest push not creating a tag
After pushing the multi-platform index fails due to missing content, we
retry with the single-platform manifest. While the target descriptor was
changed for the second push, the actual target digested reference still
pointed to the original multi-platform index. Obviously, with the
fallback that didn't really work correctly, because the multi-platform
index is not pushed.

This commit fixes the issue by updating the target reference to point to
the single-platform manifest.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-13 14:31:34 +02:00
Sebastiaan van Stijn
5dc1ccdfc8 Merge pull request #50136 from mabrarov/50133-container_stop_state_sync
fix: daemon: state of stopped container visible to other queries when container is stopped
2025-06-13 14:16:37 +02:00
Sebastiaan van Stijn
53d12c96f8 vendor: github.com/containerd/containerd/v2 v2.1.2
no significant changes other than error messages that now contain more
information

full diff: https://github.com/containerd/containerd/compare/v2.1.1...v2.1.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-13 13:50:48 +02:00
Paweł Gronowski
72145a8ad2 Merge pull request #50146 from vvoland/image-list-containers
api/image/list: Return `Containers` count
2025-06-13 11:34:38 +00:00
Rob Murray
f9e6f25677 Merge pull request #50196 from robmry/fix_TestDaemonRestartRestoreBridgeNetwork
Fix flaky test TestDaemonRestartRestoreBridgeNetwork
2025-06-13 12:21:19 +01:00
Sebastiaan van Stijn
9e985bd96f Merge pull request #50158 from mmorel-35/errorlint
fix errorlint linter
2025-06-13 12:38:38 +02:00
Rob Murray
aac0260d21 Fix flaky test TestDaemonRestartRestoreBridgeNetwork
It checked for "Bind for 0.0.0.0:80 failed: port is already
allocated". But, since commit d662091 ("portallocator: always
check for ports allocated for 0.0.0.0/::"), the message is
sometimes about ":::80".

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-13 10:53:22 +01:00
Paweł Gronowski
cfcbfabb0f api/image/list: Return Containers count
This parameter was already supported for some time in the backend (for
purposes related to docker system prune). It was also already present in
the imagetypes.ListOptions but was never actually handled by the client.

Make it available by default in the response.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-13 11:46:09 +02:00
Sebastiaan van Stijn
52a54d9ef6 Merge pull request #50176 from dmcgowan/handle-token-server-error-messages
Handle error message from token server with containerd backend
2025-06-13 10:40:33 +02:00
Matthieu MOREL
6d737371b8 fix comparison rule from errorlint
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-13 08:26:56 +00:00
Paweł Gronowski
b65c31427c Merge pull request #50174 from jsternberg/buildkit-update
vendor: github.com/moby/buildkit v0.23.0-rc1
2025-06-12 18:55:04 +00:00
Rob Murray
5de6c1f6f3 Merge pull request #50189 from thaJeztah/fix_TestCopyFromContainerPathIsNotDir
integration-cli: TestCopyFromContainerPathIsNotDir: adjust for win 2025
2025-06-12 19:54:41 +01:00
Sebastiaan van Stijn
84f5e5351c Merge pull request #50145 from vvoland/api-151
api: bump to 1.51
2025-06-12 20:18:50 +02:00
Derek McGowan
941d09e265 Handle error message from token server with containerd backend
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-12 11:13:34 -07:00
Jonathan A. Sternberg
e4e7fcf668 vendor: github.com/moby/buildkit v0.23.0-rc1
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 19:08:16 +02:00
Sebastiaan van Stijn
a057f98a30 Merge pull request #50187 from thaJeztah/bump_buildkit_deps
vendor: update buildkit and containerd dependencies
2025-06-12 19:08:04 +02:00
Sebastiaan van Stijn
d3d20b9195 integration-cli: TestCopyFromContainerPathIsNotDir: adjust for win 2025
It looks like the error returned by Windows changed in Windows 2025; before
Windows 2025, this produced a `ERROR_INVALID_NAME`;

    The filename, directory name, or volume label syntax is incorrect.

But Windows 2025 produces a `ERROR_DIRECTORY` ("The directory name is invalid."):

    CreateFile \\\\?\\Volume{d9f06b05-0405-418b-b3e5-4fede64f3cdc}\\windows\\system32\\drivers\\etc\\hosts\\: The directory name is invalid.

Docs; https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 15:18:17 +02:00
Sebastiaan van Stijn
a3d2e72958 Merge pull request #50183 from thaJeztah/remove_v1_code
daemon/containerd remove leftover schema1 compatibility code
2025-06-12 14:50:38 +02:00
Sebastiaan van Stijn
cf86f3a082 vendor: github.com/containerd/nydus-snapshotter v0.15.2
full diff: https://github.com/containerd/nydus-snapshotter/compare/v0.15.0...v0.15.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 14:07:03 +02:00
Sebastiaan van Stijn
9a85f50aaa vendor: github.com/pelletier/go-toml/v2 v2.2.4
full diff: https://github.com/pelletier/go-toml/compare/v2.2.3...v2.2.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 14:07:03 +02:00
Sebastiaan van Stijn
1764909076 vendor: github.com/fsnotify/fsnotify v1.9.0
full diff: https://github.com/fsnotify/fsnotify/compare/v1.7.0...v1.9.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 14:07:02 +02:00
Sebastiaan van Stijn
102adcab57 vendor: github.com/containerd/console v1.0.5
full diff: https://github.com/containerd/console/compare/v1.0.4...v1.0.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 14:07:02 +02:00
Sebastiaan van Stijn
5230692cad vendor: cloud.google.com/go/longrunning v0.5.5
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 14:05:28 +02:00
Sebastiaan van Stijn
5fb6604642 vendor: google.golang.org/api v0.160.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 14:03:05 +02:00
Paweł Gronowski
f2faca7de3 Merge pull request #50178 from thaJeztah/pull_clean
daemon/containerd: fix minor linting issue, and update link to error message
2025-06-12 11:49:37 +00:00
Paweł Gronowski
c430c9c7f2 Merge pull request #50115 from corhere/libn/fix-47859-networkdb-clusterleave-leak
libnetwork/networkdb: always shut down memberlist
2025-06-12 11:49:00 +00:00
Sebastiaan van Stijn
d2954c4e05 vendor: otel v1.35.0, otel/contrib v0.60.0, grpc v1.72.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 13:43:25 +02:00
Sebastiaan van Stijn
05f892190c vendor: github.com/prometheus/client_golang v1.22.0
full diff: https://github.com/prometheus/client_golang/compare/v1.20.5...v1.22.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 13:43:24 +02:00
Sebastiaan van Stijn
952cddd05b vendor: google.golang.org/protobuf v1.36.6
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 13:43:24 +02:00
Sebastiaan van Stijn
ccf5f8036c vendor: golang.org/x/sys v0.33.0
full diff: https:/github.com/golang/sys/compare/v0.32.0...v0.33.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 13:43:24 +02:00
Sebastiaan van Stijn
c81e03bc0b vendor: golang.org/x/sync v0.14.0
full diff: https://github.com/golang/sync/compare/v0.13.0...v0.14.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 13:43:24 +02:00
Paweł Gronowski
b5d26e5883 Merge pull request #50078 from vvoland/cdi-default-cache
daemon: Configure default CDI cache
2025-06-12 11:36:32 +00:00
Sebastiaan van Stijn
05e8b1701c daemon/containerd remove leftover schema1 compatibility code
commit 7c09fa25fd and
e8c269843c removed support for schema1, but
we still enabled the schema1 conversion in containerd, causing the error
produced by dockerd to be shadowed by the error from containerd;

Before this patch, we would get an error from containerd;

    docker pull docker:1.0
    Error response from daemon: failed to get converter for "docker.io/library/docker:1.0": Pulling Schema 1 images have been deprecated and disabled by default since containerd v2.0. As a workaround you may set an environment variable `CONTAINERD_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE=1`, but this will be completely removed in containerd v2.1.

After enabling that env-var, it would return the error from dockerd;

    CONTAINERD_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE=1 dockerd --feature containerd-snapshotter

    docker pull docker:1.0
    Error response from daemon: Docker Image Format v1 and Docker Image manifest version 2, schema 1 support has been removed. Suggest the author of docker.io/library/docker:1.0 to upgrade the image to the OCI Format or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/

With this patch, we immediately return the error from dockerd;

    docker pull docker:1.0
    Error response from daemon: Docker Image Format v1 and Docker Image manifest version 2, schema 1 support has been removed. Suggest the author of docker.io/library/docker:1.0 to upgrade the image to the OCI Format or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 12:34:26 +02:00
Paweł Gronowski
5bbdb066d8 Merge pull request #50031 from vvoland/bbolt-1.4
vendor: go.etcd.io/bbolt v1.4.0
2025-06-12 10:09:09 +00:00
Sebastiaan van Stijn
2ff281e33a daemon/containerd: update link to containerd code
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 11:36:08 +02:00
Sebastiaan van Stijn
d54f713d95 daemon/containerd: rename var that shadowed type
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-12 11:32:02 +02:00
Marat Abrarov
8e6cd44ce4 daemon: ensuring state of stopped container is visible to other queries when container is stopped and before API response is sent (fix for https://github.com/moby/moby/issues/50133).
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
2025-06-11 18:08:33 +03:00
Sebastiaan van Stijn
3b1d2f746d Merge pull request #49952 from sgopinath1/49824-amd-gpu
Added support for AMD GPUs in "docker run --gpus".
2025-06-11 14:48:58 +02:00
Sebastiaan van Stijn
349a2d0050 Merge pull request #50143 from marie/validate-bind-dir
Validate BIND_DIR variable in Makefile
2025-06-11 14:11:45 +02:00
Rob Murray
7acb079403 Revert "libn/networkdb: don't exceed broadcast size limit"
This reverts commit dacf445614.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-11 12:05:49 +01:00
Rob Murray
0df31cf585 Revert "libn/networkdb: fix data race in GetTableByNetwork"
This reverts commit ec65f2d21b.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-11 12:05:48 +01:00
Rob Murray
83b2fc245d Revert "Fix possible overlapping IPs when ingressNA == nil"
This reverts commit 56ad941564.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-11 12:05:46 +01:00
Rob Murray
e079583ab4 Revert "libnetwork/networkdb: use correct index in GetTableByNetwork"
This reverts commit d5c370dee6.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-11 12:05:45 +01:00
Rob Murray
cfd5e5e4d4 Revert "libn/networkdb: b'cast watch events from local POV"
This reverts commit c68671d908.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-11 12:05:44 +01:00
Rob Murray
576cf73add Revert "libn/networkdb: record tombstones for all deletes"
This reverts commit ada8bc3695.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-11 12:05:43 +01:00
Rob Murray
2297ae3e64 Revert "libn/networkdb: Watch() without race conditions"
This reverts commit a3aea15257.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-11 12:05:41 +01:00
Rob Murray
cc60ec8d3c Revert "libn/networkdb: stop table events from racing network leaves"
This reverts commit 270a4d41dc.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-11 12:05:40 +01:00
Rob Murray
b5b349dbd6 Revert "libn/osl: drop unused AddNeighbor force parameter"
This reverts commit 3bdf99d127.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-11 12:05:39 +01:00
Rob Murray
35916f0869 Revert "libn/osl: refactor func (*Namespace) AddNeighbor"
This reverts commit b6d76eb572.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-11 12:05:38 +01:00
Rob Murray
3eb59ba5a2 Revert "libnetwork/osl: remove superfluous locks in Namespace"
This reverts commit 9866738736.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-11 12:05:37 +01:00
Rob Murray
5d6ae34753 Revert "libnetwork/osl: stop tracking neighbor entries"
This reverts commit 0d6e7cd983.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-11 12:05:36 +01:00
Rob Murray
ea818a7f6f Revert "libnetwork/internal/setmatrix: make keys generic"
This reverts commit 0317f773a6.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-11 12:05:33 +01:00
Rob Murray
78ccc20545 Revert "libn/d/overlay: use netip types more"
This reverts commit d188df0039.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-11 12:05:26 +01:00
Paweł Gronowski
86091394e9 Merge pull request #50164 from thaJeztah/fix_linting_nits
fix some linting issues
2025-06-11 10:46:15 +00:00
Rob Murray
6b9bd0a800 Merge pull request #50144 from thaJeztah/rm_import_aliases
all: remove redundant import-aliases for "go-winio"
2025-06-11 11:25:05 +01:00
Paweł Gronowski
d371ea117b Merge pull request #50156 from gagara/openrc-containerd-customization
openrc: allow customizing containerd service name
2025-06-11 09:24:11 +00:00
Paweł Gronowski
e84353ebbd Merge pull request #50135 from thaJeztah/inspect_no_omitempty
api: image inspect: add back fields that did not omitempty
2025-06-11 08:58:14 +00:00
Sebastiaan van Stijn
23c56099ee daemon/logger/loggerutils: use defer to fix gocritic "badlock" linter
daemon/logger/loggerutils/logfile.go:374:2: badLock: defer is missing, mutex is unlocked immediately (gocritic)
        w.rotateMu.Unlock()
        ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-10 13:54:56 +02:00
Sebastiaan van Stijn
0069360e3b volume/mounts: windowsDetectMountType: rewrite using switch
Mostly for readability, and to avoid linters suggesting to move the
default condition outside of the if/else.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-10 13:19:25 +02:00
Sebastiaan van Stijn
027355d7b3 container/stream: TestRaceUnbuffered: put unused testing.T to use
Some linters were complaining about the testing.T not being used; put
it to use to silence the linter.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-10 13:15:05 +02:00
Sebastiaan van Stijn
2bbf5f5a39 daemon/containerd: ImageService.resolveImage: cleanup resolve by name:tag
- scope variables locally to the if/else if
- use if/else if to try to make it more clear it's a "best effort" before
  falling through to other ways of resolving the image reference
- remove outdated TODO, now that containerd errdefs can be used for either
  moby, or containerd error definitions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-10 13:13:44 +02:00
Sebastiaan van Stijn
13879e7b49 Merge pull request #50082 from mmorel-35/go-critic
fix go-critic linter
2025-06-10 13:09:05 +02:00
Paweł Gronowski
729cbbd5c0 Merge pull request #49950 from dmcgowan/contributing-package-location
Add contributor guidelines for where to put source code in packages
2025-06-10 10:56:43 +00:00
Paweł Gronowski
52a8109a6b Merge pull request #50155 from robmry/windows_no_mirrored_plugin
Windows: don't try to load "mirrored" network plugin
2025-06-10 09:36:22 +00:00
Tianon Gravi
b2d4925e4a Merge pull request #50154 from robmry/dont_prune_windows_host_networks
Only "prune" Windows networks created by Docker
2025-06-09 15:28:51 -07:00
Paweł Gronowski
2e25775c83 libnetwork: Replace deprecated usages
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-09 19:30:00 +02:00
Paweł Gronowski
3dd8f03f25 vendor: go.etcd.io/bbolt v1.4.0
full diff: https://github.com/etcd-io/bbolt/compare/v1.3.11...v1.4.0

Changelog: https://github.com/etcd-io/bbolt/blob/main/CHANGELOG/CHANGELOG-1.4.md

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-09 19:29:58 +02:00
Rob Murray
55f47f9e34 Windows: don't try to load "mirrored" network plugin
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-09 11:38:13 +01:00
Matthieu MOREL
20b6075380 fix badCall from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-08 09:02:11 +02:00
Viacheslav Gagara
10c4715a62 openrc: allow customizing containerd service name
Signed-off-by: Viacheslav Gagara <viacheslavg@gmail.com>
2025-06-08 09:10:59 +03:00
Matthieu MOREL
c466ae0f71 fix badLock from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
19f5ac3c81 fix initClause from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
aa632664b6 fix mapKey from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
5ad4e4edf7 fix deprecatedComment from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
b8a4f6534f fix stringsCompare and stringConcatSimplify from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
a62de57aa1 fix sprintfQuotedString from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
bc9ec5fc02 fix emptyStringTest from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
469afa5f8f fix httpNoBody from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:58 +02:00
Matthieu MOREL
8f7faa01d1 fix boolExprSimplify from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:58 +02:00
Matthieu MOREL
e5be7b54b1 fix yodaStyleExpr from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:58 +02:00
Matthieu MOREL
64075850fc fix go-critic linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:58 +02:00
Sebastiaan van Stijn
145834f278 Merge pull request #50153 from vvoland/update-go
update to go1.24.4
2025-06-07 07:37:53 +02:00
Rob Murray
793dd8385a Only "prune" Windows networks created by Docker
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-06 20:24:04 +01:00
Derek McGowan
071d27cd3d Add contributor guidelines for where to put source code in packages
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-06 11:31:04 -07:00
Paweł Gronowski
1603ad636e update to go1.24.4
- https://github.com/golang/go/issues?q=milestone%3AGo1.24.4+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.24.3...go1.24.4

This release includes 3 security fixes following the security policy:

- net/http: sensitive headers not cleared on cross-origin redirect

    Proxy-Authorization and Proxy-Authenticate headers persisted on cross-origin redirects potentially leaking sensitive information.

    Thanks to Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.) for reporting this issue.

    This is CVE-2025-4673 and Go issue https://go.dev/issue/73816.

- os: inconsistent handling of O_CREATE|O_EXCL on Unix and Windows

    os.OpenFile(path, os.O_CREATE|O_EXCL) behaved differently on Unix and Windows systems when the target path was a dangling symlink. On Unix systems, OpenFile with O_CREATE and O_EXCL flags never follows symlinks. On Windows, when the target path was a symlink to a nonexistent location, OpenFile would create a file in that location.

    OpenFile now always returns an error when the O_CREATE and O_EXCL flags are both set and the target path is a symlink.

    Thanks to Junyoung Park and Dong-uk Kim of KAIST Hacking Lab for discovering this issue.

    This is CVE-2025-0913 and Go issue https://go.dev/issue/73702.

- crypto/x509: usage of ExtKeyUsageAny disables policy validation

    Calling Verify with a VerifyOptions.KeyUsages that contains ExtKeyUsageAny unintentionally disabledpolicy validation. This only affected certificate chains which contain policy graphs, which are rather uncommon.

    Thanks to Krzysztof Skrzętnicki (@Tener) of Teleport for reporting this issue.

    This is CVE-2025-22874 and Go issue https://go.dev/issue/73612.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-06 19:35:32 +02:00
Sebastiaan van Stijn
2da78d4fcc Merge pull request #50022 from mmorel-35/thelper
fix thelper linter
2025-06-06 09:53:29 +02:00
Matthieu MOREL
9b5d8cd186 fix thelper linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-05 21:42:05 +00:00
Maria Glushenok
ea581c96b9 Validate BIND_DIR variable in Makefile
Signed-off-by: Maria Glushenok <glushenokm@gmail.com>
2025-06-05 20:43:41 +03:00
Sebastiaan van Stijn
59bdc72463 Merge pull request #50147 from robmry/inspect_overlay_enableipv4
Set EnableIPv4=true in overlay network inspect response
2025-06-05 19:08:48 +02:00
Sudheendra Gopinath
e32715ec03 Added support for AMD GPUs in "docker run --gpus".
Added backend code to support the exact same interface
used today for Nvidia GPUs, allowing customers to use
the same docker commands for both Nvidia and AMD GPUs.

Signed-off-by: Sudheendra Gopinath <sudheendra.gopinath@amd.com>

Reused common functions from nvidia_linux.go.

Removed duplicate code in amd_linux.go by reusing
the init() and countToDevices() functions in
nvidia_linux.go. AMD driver is registered in init().

Signed-off-by: Sudheendra Gopinath <sudheendra.gopinath@amd.com>

Renamed amd-container-runtime constant

Signed-off-by: Sudheendra Gopinath <sudheendra.gopinath@amd.com>

Removed empty branch to keep linter happy.

Also renamed amd_linux.go to gpu_amd_linux.go.

Signed-off-by: Sudheendra Gopinath <sudheendra.gopinath@amd.com>

Renamed nvidia_linux.go and gpu_amd_linux.go.

Signed-off-by: Sudheendra Gopinath <sudheendra.gopinath@amd.com>
2025-06-05 14:44:18 +00:00
Rob Murray
6bac5ca833 Set EnableIPv4=true in overlay network inspect response
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-05 15:27:32 +01:00
Paweł Gronowski
27f2e0ecc5 api: bump to 1.51
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-05 12:32:48 +02:00
Sebastiaan van Stijn
bd20bfdc41 all: remove redundant import-aliases for "go-winio"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-05 12:11:30 +02:00
Sebastiaan van Stijn
acac1d84ce Merge pull request #50127 from thaJeztah/swagger_uint
api/swagger: quote maxUint64 example value
2025-06-05 11:59:20 +02:00
Akihiro Suda
c29de525b8 Merge pull request #50087 from vvoland/vendor-miekgdns
vendor: github.com/miekg/dns v1.1.66
2025-06-05 15:24:33 +09:00
Sebastiaan van Stijn
f85394dd5d api: image inspect: add back fields that did not omitempty
commit 4dc961d0e9 removed deprecated
fields from the image inspect response for API v1.50 and up. As
part of that change, it changed the type used for the Config field
to use the docker image spect structs, which embeds the OCI image
spec structs.

While the OCI image spect struct contains the same fields as we
used before, those fields also have "omitempty" set, which means
they are now omitted when empty.

We should probably consider deprecating that behavior in the API,
and call out that these fields are omitted if not set, but in the
meantime, we can add them back with their default (zero) value.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-04 18:01:19 +02:00
Rob Murray
9663b36b6d Merge pull request #50054 from robmry/fix_port_mapping
Avoid selecting duplicate host ports for mappings to 0.0.0.0 and specific addresses
2025-06-04 16:46:29 +01:00
Sebastiaan van Stijn
ee69d8ac95 Merge pull request #50051 from robmry/nftables_no_docker_user
nftables: don't create DOCKER-USER iptables chains
2025-06-03 13:19:12 +02:00
Sebastiaan van Stijn
e2b9f3d844 Merge pull request #50059 from shangmu/master
dockerd-rootless-setuptool.sh: Fix silent stop on error due to using output redirection together wit…
2025-06-03 12:05:03 +02:00
Paweł Gronowski
a8d3645957 Merge pull request #50128 from thaJeztah/bump_cli
Dockerfile: update cli to v28.2.2
2025-06-02 14:14:39 +00:00
Sebastiaan van Stijn
a9fabe7f0e Merge pull request #50124 from thaJeztah/resolvconf_table_test
libnetwork/resolvconf: Build: decorate error for invalid nameservers and use table-tests
2025-06-02 15:51:41 +02:00
Sebastiaan van Stijn
284904119a Dockerfile: update cli to v28.2.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-02 14:54:44 +02:00
Sebastiaan van Stijn
8ba832cc8f docs/api: swagger: quote maxUint64 example value
More recent versions of go-swagger failed on this, because the value
is interpolated as JSON numberic value, which assumes int64 (signed).

Quote the value to prevent it being handled before validated against
uint64.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-02 14:47:48 +02:00
Sebastiaan van Stijn
affe1d6335 api/swagger: quote maxUint64 example value
More recent versions of go-swagger failed on this, because the value
is interpolated as JSON numberic value, which assumes int64 (signed).

Quote the value to prevent it being handled before validated against
uint64.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-02 14:45:11 +02:00
Sebastiaan van Stijn
b6fa565cba libnetwork/resolvconf: Build: decorate error for invalid nameservers
Using the same prefix as is used in `Sandbox.loadResolvConf`, but omiting
the value, as it's already part of the error message;
829b695375/libnetwork/sandbox_dns_unix.go (L258-L261)

Unfortunately, `netip.ParseAddr` returns a non-exported (`parseAddrError`)
error-type; https://cs.opensource.google/go/go/+/refs/tags/go1.24.3:src/net/netip/netip.go;l=115

So we don't have the option to omit the `` from the error-message, and to
take the underlying `msg` field;
https://cs.opensource.google/go/go/+/refs/tags/go1.24.3:src/net/netip/netip.go;l=141-153

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-02 12:33:28 +02:00
Sebastiaan van Stijn
35e062dde1 libnetwork/resolvconf: rewrite TestBuild tests to a table-test
Also adding test-cases for;

- empty options for all fields
- invalid nameServer (domain instead of IP).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-02 12:20:19 +02:00
Akihiro Suda
829b695375 Merge pull request #50109 from vvoland/binimage-nosha
gha/bin-image: Don't push sha tags
2025-05-31 15:52:08 +09:00
Sebastiaan van Stijn
9649dc8134 Merge pull request #50110 from thaJeztah/remove_import_comments
all: remove // import comments
2025-05-30 20:35:54 +02:00
Cory Snider
16ed51d864 libnetwork/networkdb: always shut down memberlist
Gracefully leaving the memberlist cluster is a best-effort operation.
Failing to successfully broadcast the leave message to a peer should not
prevent NetworkDB from cleaning up the memberlist instance on close. But
that was not the case in practice. Log the error returned from
(*memberlist.Memberlist).Leave instead of returning it and proceed with
shutting down irrespective of whether Leave() returns an error.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-05-30 13:56:47 -04:00
Sebastiaan van Stijn
c1a27ea5af pkg/stack: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:22 +02:00
Sebastiaan van Stijn
dd382769bd pkg/rootless: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:22 +02:00
Sebastiaan van Stijn
ce191648c7 pkg/useragent: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:21 +02:00
Sebastiaan van Stijn
ad1a388895 pkg/tailfile: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:21 +02:00
Sebastiaan van Stijn
b6f99f6d7f pkg/stringid: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:21 +02:00
Sebastiaan van Stijn
ca2cca1286 pkg/stdcopy: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:21 +02:00
Sebastiaan van Stijn
225b7ca6b7 pkg/progress: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:21 +02:00
Sebastiaan van Stijn
0f9818ad03 pkg/pools: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:20 +02:00
Sebastiaan van Stijn
f0f4fa0038 pkg/plugingetter: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:20 +02:00
Sebastiaan van Stijn
5f4da92972 pkg/platform: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:20 +02:00
Sebastiaan van Stijn
7a703f3772 pkg/pidfile: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:20 +02:00
Sebastiaan van Stijn
511cf09e75 pkg/namesgenerator: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:19 +02:00
Sebastiaan van Stijn
864e3f9348 pkg/longpath: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:19 +02:00
Sebastiaan van Stijn
cc329af619 pkg/jsonmessage: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:19 +02:00
Sebastiaan van Stijn
0c70c762b2 pkg/streamformatter: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:19 +02:00
Sebastiaan van Stijn
fd8b6a24ab pkg/tarsum: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:19 +02:00
Sebastiaan van Stijn
17845556f2 pkg/system: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:19 +02:00
Sebastiaan van Stijn
18a1b61b49 pkg/sysinfo: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:18 +02:00
Sebastiaan van Stijn
126246ae39 pkg/plugins: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:18 +02:00
Sebastiaan van Stijn
0380c952a6 pkg/parsers: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:18 +02:00
Sebastiaan van Stijn
4800a9b50d pkg/ioutils: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:18 +02:00
Sebastiaan van Stijn
ca3982adea pkg/homedir: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:17 +02:00
Sebastiaan van Stijn
c93f18e0b8 pkg/fileutils: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:17 +02:00
Sebastiaan van Stijn
6a9f7c543c pkg/authorization: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:17 +02:00
Sebastiaan van Stijn
a4411f497f errdefs: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:17 +02:00
Sebastiaan van Stijn
0ea03c4add opts: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:16 +02:00
Sebastiaan van Stijn
7ce4e9685a oci: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:16 +02:00
Sebastiaan van Stijn
23009a700a testutil: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:16 +02:00
Sebastiaan van Stijn
fe1bc3e7fd runconfig: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:16 +02:00
Sebastiaan van Stijn
4656712b82 restartmanager: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:15 +02:00
Sebastiaan van Stijn
134f20c828 reference: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:15 +02:00
Sebastiaan van Stijn
97b20f6b79 registry: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:15 +02:00
Sebastiaan van Stijn
2548254317 quota: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:15 +02:00
Sebastiaan van Stijn
66055ea07c plugin: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:15 +02:00
Sebastiaan van Stijn
3bbb38f1d2 volume: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:14 +02:00
Sebastiaan van Stijn
021dd75bc4 libcontainerd: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:14 +02:00
Sebastiaan van Stijn
fe34e89992 layer: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:14 +02:00
Sebastiaan van Stijn
9abf9f2d0d internal: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:14 +02:00
Sebastiaan van Stijn
4970333621 integration: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:14 +02:00
Sebastiaan van Stijn
a4b0d32fa6 integration-cli: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:13 +02:00
Sebastiaan van Stijn
7eecd04c7b image: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:13 +02:00
Sebastiaan van Stijn
c1a3c51d9e dockerversion: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:13 +02:00
Sebastiaan van Stijn
c7cb2d9783 distribution: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:13 +02:00
Sebastiaan van Stijn
5318877858 daemon: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:13 +02:00
Sebastiaan van Stijn
076e98e8f3 daemon/links, daemon/network: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:12 +02:00
Sebastiaan van Stijn
2b42088bd5 daemon/listeners: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:12 +02:00
Sebastiaan van Stijn
241e0bca8b daemon/events: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:12 +02:00
Sebastiaan van Stijn
27956106d5 daemon/config: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:12 +02:00
Sebastiaan van Stijn
69c34390c0 daemon/logger: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:12 +02:00
Sebastiaan van Stijn
7d4caf4ba8 daemon/images: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:12 +02:00
Sebastiaan van Stijn
9876c9fbcf daemon/graphdriver: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:11 +02:00
Sebastiaan van Stijn
986ec3f877 daemon/cluster: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:11 +02:00
Sebastiaan van Stijn
89aa33001e container: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:11 +02:00
Sebastiaan van Stijn
d469079338 cmd: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:11 +02:00
Sebastiaan van Stijn
c6bbc3bb6e builder: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:11 +02:00
Sebastiaan van Stijn
4856e8ffad client: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:10 +02:00
Sebastiaan van Stijn
bf9d739561 api: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:01 +02:00
Sebastiaan van Stijn
cee6f64ac7 Merge pull request #50112 from thaJeztah/libnet_overlayutils_overflow
libnet/d/overlay/overlayutils: prevent uint32 overflow
2025-05-30 15:56:00 +02:00
Sebastiaan van Stijn
f1f9950e4a Merge pull request #50111 from thaJeztah/fluentd_overflow
daemon/logger/fluentd: cap max-retries to MaxInt32
2025-05-30 15:55:32 +02:00
Sebastiaan van Stijn
fca97dae9d libnet/d/overlay/overlayutils: prevent uint32 overflow
CodeQL was complaining about the conversion to uint32

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 14:00:14 +02:00
Sebastiaan van Stijn
3d8195a20f daemon/logger/fluentd: cap max-retries to MaxInt32
CodeQL was warning about a potential overflow; the default value
was set to MaxInt32 in 13086f387b,
which documented that higher values caused problems, so cap it
to that value as maximum.

45873be4ae/daemon/logger/fluentd/fluentd.go (L45-L47)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 13:50:55 +02:00
Paweł Gronowski
404f29c42d gha/bin-image: Don't push sha tags
This change eliminates the automatic creation of image tags in the
format `moby/moby-bin:sha-ad132f5` for every push.

They're not too useful, produce noise and use a lot of space.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-05-30 11:43:05 +02:00
Paweł Gronowski
45873be4ae Merge pull request #50105 from jsternberg/revert-build-dangling
Revert "containerd: images overridden by a build are kept dangling"
2025-05-30 08:53:59 +00:00
Jonathan A. Sternberg
7994426e61 Revert "containerd: images overridden by a build are kept dangling"
This reverts commit 50a856157c.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-05-29 13:23:45 -05:00
Cory Snider
f144264bae Merge pull request #50090 from corhere/libn/overlay-netip
libnetwork/d/overlay: use netip types more
2025-05-29 14:12:28 -04:00
Rob Murray
a2652d4b81 Don't set up iptables chain DOCKER-USER when using nftables
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-05-29 19:12:23 +01:00
Rob Murray
768cfaeb62 Merge pull request #50050 from robmry/nftables_internal_dns
nftables: rules for the internal DNS resolver
2025-05-29 19:11:27 +01:00
Rob Murray
d3289dda4b Add nftables NAT rules for internal DNS resolver
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-05-29 17:20:25 +01:00
Sebastiaan van Stijn
7a0bf747f5 Merge pull request #50038 from ctalledo/fix-for-50037
Update worker.Platforms() in builder-next worker.
2025-05-29 16:09:38 +02:00
Rob Murray
b43afbf898 Merge pull request #50098 from robmry/remove_docker-user_return_rule
iptables: Drop explicit RETURN rule from DOCKER-USER
2025-05-29 11:27:54 +01:00
Cesar Talledo
c299ba3b38 Update worker.Platforms() in builder-next worker.
Use platform MatchComparer when checking for matching platforms.

Also, add unit test to ensure the merging of defined and host-supported
platforms works correctly.

Signed-off-by: Cesar Talledo <cesar.talledo@docker.com>
2025-05-28 14:47:59 -07:00
Shang Mu
6889039d76 Fix silent stop on error due to using output redirection together with set -eu.
Signed-off-by: Shang Mu <smu@princeton.edu>
2025-05-28 13:23:52 -04:00
Rob Murray
d6620915db portallocator: always check for ports allocated for 0.0.0.0/::
We set SO_REUSEADDR on sockets used for host port mappings by
docker-proxy - which means it's possible to bind the same port
on a specific address as well as 0.0.0.0/::.

For TCP sockets, an error is raised when listen() is called on
both sockets - and the port allocator will be called again to
avoid the clash (if the port was allocated from a range, otherwise
the container will just fail to start).

But, for UDP sockets, there's no listen() - so take more care
to avoid the clash in the portallocator.

The port allocator keeps a set of allocated ports for each of
the host IP addresses it's seen, including 0.0.0.0/::. So, if a
mapping to 0.0.0.0/:: is requested, find a port that's free in
the range for each of the known IP addresses (but still only
mark it as allocated against 0.0.0.0/::). And, if a port is
requested for specific host addresses, make sure it's also
free in the corresponding 0.0.0.0/:: set (but only mark it as
allocated against the specific addresses - because the same
port can be allocated against a different specific address).

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-05-28 14:00:33 +01:00
Paweł Gronowski
027588eba0 builder: Pass cdi cache instead of CDISpecDirs
Instead of passing the dirs for buildkit to configure the same cache
instance, just pass the shared CDI cache instance.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-05-28 13:31:45 +02:00
Paweł Gronowski
bc6bc7aafa daemon/cdi: Log not found dirs as INFO
Avoid logging warnings when default CDI directory does not exist:
```
WARN[2025-05-26T14:27:54.008196418Z] CDI setup error /var/run/cdi: failed to monitor for changes: no such file or directory
WARN[2025-05-26T14:27:54.008209168Z] CDI setup error /etc/cdi: failed to monitor for changes: no such file or directory
```

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-05-28 13:31:42 +02:00
Paweł Gronowski
9856bf52a2 daemon: Configure default CDI cache
And share it with BuildKit

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-05-28 13:31:40 +02:00
Rob Murray
ae2fc2ddd1 PortAllocator: Use netip.Addr instead of string as map key
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-05-28 11:38:59 +01:00
Rob Murray
19dc38f79b Listen on mapped host ports before mapping more ports
Because we set SO_REUSEADDR on sockets for host ports, if there
are port mappings for INADDR_ANY (the default) as well as for
specific host ports - bind() cannot be used to detect clashes.

That means, for example, on daemon startup, if the port allocator
returns the first port in its ephemeral range for a specific host
adddress, and the next port mapping is for 0.0.0.0 - the same port
is returned and both bind() calls succeed. Then, the container
fails to start later when listen() spots the problem and it's too
late to find another port.

So, bind and listen to each set of ports as they're allocated
instead of just binding.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-05-28 11:38:59 +01:00
Rob Murray
dc519a0f18 iptables: Drop explicit RETURN rule from DOCKER-USER
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-05-28 11:11:56 +01:00
Cory Snider
d188df0039 libn/d/overlay: use netip types more
The netip types are really useful for tracking state in the overlay
driver as they are hashable, unlike net.IP and friends, making them
directly useable as map keys. Converting between netip and net types is
fairly trivial, but fewer conversions is more ergonomic.

The NetworkDB entries for the overlay peer table encode the IP addresses
as strings. We need to parse them to some representation before
processing them further. Parse directly into netip types and pass those
values around to cut down on the number of conversions needed.

The peerDB needs to marshal the keys and entries to structs of hashable
values to be able to insert them into the SetMatrix. Use netip.Addr in
peerEntry so that peerEntry values can be directly inserted into the
SetMatrix without conversions. Use a hashable struct type as the
SetMatrix key to avoid having to marshal the whole struct to a string
and parse it back out.

Use netip.Addr as the map key for the driver's encryption map so the
values do not need to be converted to and from strings. Change the
encryption configuration methods to take netip types so the peerDB code
can pass netip values directly.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-05-27 13:47:11 -04:00
Cory Snider
0317f773a6 libnetwork/internal/setmatrix: make keys generic
Make the SetMatrix key's type generic so that e.g. netip.Addr values can
be used as matrix keys.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-05-27 13:29:41 -04:00
Paweł Gronowski
f834a0bd82 vendor: github.com/miekg/dns v1.1.66
full diff: https://github.com/miekg/dns/compare/v1.1.61...v1.1.66

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-05-27 15:09:09 +02:00
2257 changed files with 56354 additions and 26325 deletions

View File

@@ -16,7 +16,7 @@ on:
workflow_call:
env:
GO_VERSION: "1.24.3"
GO_VERSION: "1.24.9"
GOTESTLIST_VERSION: v0.3.1
TESTSTAT_VERSION: v0.1.25
SETUP_BUILDX_VERSION: edge
@@ -106,7 +106,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
cache: false
-
name: Download reports
uses: actions/download-artifact@v4

View File

@@ -21,7 +21,7 @@ on:
default: "graphdriver"
env:
GO_VERSION: "1.24.3"
GO_VERSION: "1.24.9"
GOTESTLIST_VERSION: v0.3.1
TESTSTAT_VERSION: v0.1.25
ITG_CLI_MATRIX_SIZE: 6
@@ -265,7 +265,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
cache: false
-
name: Download reports
uses: actions/download-artifact@v4
@@ -297,7 +297,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
cache: false
-
name: Install gotestlist
run:
@@ -454,7 +454,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
cache: false
-
name: Download reports
uses: actions/download-artifact@v4

View File

@@ -28,12 +28,12 @@ on:
default: false
env:
GO_VERSION: "1.24.3"
GO_VERSION: "1.24.9"
GOTESTLIST_VERSION: v0.3.1
TESTSTAT_VERSION: v0.1.25
WINDOWS_BASE_IMAGE: mcr.microsoft.com/windows/servercore
WINDOWS_BASE_TAG_2019: ltsc2019
WINDOWS_BASE_TAG_2022: ltsc2022
WINDOWS_BASE_TAG_2025: ltsc2025
TEST_IMAGE_NAME: moby:test
TEST_CTN_NAME: moby
DOCKER_BUILDKIT: 0
@@ -65,23 +65,11 @@ jobs:
run: |
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go-build"
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go\pkg\mod"
If ("${{ inputs.os }}" -eq "windows-2019") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
If ("${{ inputs.os }}" -eq "windows-2025") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2025 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
} ElseIf ("${{ inputs.os }}" -eq "windows-2022") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
-
name: Cache
uses: actions/cache@v4
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
${{ github.workspace }}\go-build
${{ env.GOPATH }}\pkg\mod
key: ${{ inputs.os }}-${{ github.job }}-${{ hashFiles('**/vendor.sum') }}
restore-keys: |
${{ inputs.os }}-${{ github.job }}-
-
name: Docker info
run: |
@@ -92,15 +80,12 @@ jobs:
& docker build `
--build-arg WINDOWS_BASE_IMAGE `
--build-arg WINDOWS_BASE_IMAGE_TAG `
--build-arg GO_VERSION `
-t ${{ env.TEST_IMAGE_NAME }} `
-f Dockerfile.windows .
-
name: Build binaries
run: |
& docker run --name ${{ env.TEST_CTN_NAME }} -e "DOCKER_GITCOMMIT=${{ github.sha }}" `
-v "${{ github.workspace }}\go-build:C:\Users\ContainerAdministrator\AppData\Local\go-build" `
-v "${{ github.workspace }}\go\pkg\mod:C:\gopath\pkg\mod" `
${{ env.TEST_IMAGE_NAME }} hack\make.ps1 -Daemon -Client
-
name: Copy artifacts
@@ -145,23 +130,11 @@ jobs:
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go-build"
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go\pkg\mod"
New-Item -ItemType "directory" -Path "bundles"
If ("${{ inputs.os }}" -eq "windows-2019") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
If ("${{ inputs.os }}" -eq "windows-2025") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2025 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
} ElseIf ("${{ inputs.os }}" -eq "windows-2022") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
-
name: Cache
uses: actions/cache@v4
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
${{ github.workspace }}\go-build
${{ env.GOPATH }}\pkg\mod
key: ${{ inputs.os }}-${{ github.job }}-${{ hashFiles('**/vendor.sum') }}
restore-keys: |
${{ inputs.os }}-${{ github.job }}-
-
name: Docker info
run: |
@@ -172,15 +145,12 @@ jobs:
& docker build `
--build-arg WINDOWS_BASE_IMAGE `
--build-arg WINDOWS_BASE_IMAGE_TAG `
--build-arg GO_VERSION `
-t ${{ env.TEST_IMAGE_NAME }} `
-f Dockerfile.windows .
-
name: Test
run: |
& docker run --name ${{ env.TEST_CTN_NAME }} -e "DOCKER_GITCOMMIT=${{ github.sha }}" `
-v "${{ github.workspace }}\go-build:C:\Users\ContainerAdministrator\AppData\Local\go-build" `
-v "${{ github.workspace }}\go\pkg\mod:C:\gopath\pkg\mod" `
-v "${{ env.GOPATH }}\src\github.com\docker\docker\bundles:C:\gopath\src\github.com\docker\docker\bundles" `
${{ env.TEST_IMAGE_NAME }} hack\make.ps1 -TestUnit
-
@@ -214,7 +184,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
cache: false
-
name: Download artifacts
uses: actions/download-artifact@v4
@@ -244,7 +214,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
cache: false
-
name: Install gotestlist
run:
@@ -297,6 +267,12 @@ jobs:
uses: actions/checkout@v4
with:
path: ${{ env.GOPATH }}/src/github.com/docker/docker
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
-
name: Set up Jaeger
run: |
@@ -321,8 +297,8 @@ jobs:
name: Init
run: |
New-Item -ItemType "directory" -Path "bundles"
If ("${{ inputs.os }}" -eq "windows-2019") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
If ("${{ inputs.os }}" -eq "windows-2025") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2025 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
} ElseIf ("${{ inputs.os }}" -eq "windows-2022") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
@@ -428,12 +404,6 @@ jobs:
& "${{ env.BIN_OUT }}\docker" images
env:
DOCKER_HOST: npipe:////./pipe/docker_engine
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
-
name: Test integration
if: matrix.test == './...'
@@ -527,7 +497,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
cache: false
-
name: Download reports
uses: actions/download-artifact@v4

View File

@@ -23,7 +23,7 @@ on:
pull_request:
env:
GO_VERSION: "1.24.3"
GO_VERSION: "1.24.9"
TESTSTAT_VERSION: v0.1.25
DESTDIR: ./build
SETUP_BUILDX_VERSION: edge
@@ -37,6 +37,7 @@ jobs:
build:
runs-on: ubuntu-24.04-arm
timeout-minutes: 20 # guardrails timeout for the whole job
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- validate-dco
strategy:
@@ -70,6 +71,7 @@ jobs:
build-dev:
runs-on: ubuntu-24.04-arm
timeout-minutes: 120 # guardrails timeout for the whole job
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- validate-dco
steps:
@@ -87,12 +89,13 @@ jobs:
targets: dev
set: |
*.cache-from=type=gha,scope=dev-arm64
*.cache-to=type=gha,scope=dev-arm64,mode=max
*.cache-to=type=gha,scope=dev-arm64
*.output=type=cacheonly
test-unit:
runs-on: ubuntu-24.04-arm
timeout-minutes: 120 # guardrails timeout for the whole job
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- build-dev
steps:
@@ -109,6 +112,9 @@ jobs:
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Build dev image
uses: docker/bake-action@v6
@@ -150,7 +156,7 @@ jobs:
runs-on: ubuntu-24.04
timeout-minutes: 10
continue-on-error: ${{ github.event_name != 'pull_request' }}
if: always()
if: always() && (github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only'))
needs:
- test-unit
steps:
@@ -159,7 +165,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
cache: false
-
name: Download reports
uses: actions/download-artifact@v4
@@ -179,6 +185,7 @@ jobs:
runs-on: ubuntu-24.04-arm
timeout-minutes: 120 # guardrails timeout for the whole job
continue-on-error: ${{ github.event_name != 'pull_request' }}
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- build-dev
steps:
@@ -198,6 +205,9 @@ jobs:
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Build dev image
uses: docker/bake-action@v6
@@ -249,7 +259,7 @@ jobs:
runs-on: ubuntu-24.04
timeout-minutes: 10
continue-on-error: ${{ github.event_name != 'pull_request' }}
if: always()
if: always() && (github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only'))
needs:
- test-integration
steps:
@@ -258,7 +268,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
cache: false
-
name: Download reports
uses: actions/download-artifact@v4

View File

@@ -42,6 +42,7 @@ jobs:
prepare:
runs-on: ubuntu-24.04
timeout-minutes: 20 # guardrails timeout for the whole job
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
outputs:
platforms: ${{ steps.platforms.outputs.matrix }}
steps:
@@ -65,13 +66,12 @@ jobs:
# moby/moby-bin:master
## push on 23.0 branch
# moby/moby-bin:23.0
## any push
# moby/moby-bin:sha-ad132f5
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
type=ref,event=pr
type=sha
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
-
name: Rename meta bake definition file
# see https://github.com/docker/metadata-action/issues/381#issuecomment-1918607161
@@ -94,11 +94,11 @@ jobs:
build:
runs-on: ubuntu-24.04
timeout-minutes: 120 # guardrails timeout for the whole job
timeout-minutes: 20 # guardrails timeout for the whole job
if: ${{ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && (github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only')) }}
needs:
- validate-dco
- prepare
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
strategy:
fail-fast: false
matrix:
@@ -170,10 +170,10 @@ jobs:
merge:
runs-on: ubuntu-24.04
timeout-minutes: 120 # guardrails timeout for the whole job
timeout-minutes: 40 # guardrails timeout for the whole job
if: ${{ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && github.event_name != 'pull_request' && github.repository == 'moby/moby' }}
needs:
- build
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && github.event_name != 'pull_request' && github.repository == 'moby/moby'
steps:
-
name: Download meta bake definition

View File

@@ -23,7 +23,7 @@ on:
pull_request:
env:
GO_VERSION: "1.24.3"
GO_VERSION: "1.24.9"
DESTDIR: ./build
SETUP_BUILDX_VERSION: edge
SETUP_BUILDKIT_IMAGE: moby/buildkit:latest
@@ -35,6 +35,7 @@ jobs:
build-linux:
runs-on: ubuntu-24.04
timeout-minutes: 120 # guardrails timeout for the whole job
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- validate-dco
steps:
@@ -62,6 +63,7 @@ jobs:
test-linux:
runs-on: ubuntu-24.04
timeout-minutes: 120 # guardrails timeout for the whole job
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- build-linux
env:
@@ -106,7 +108,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
cache: false
-
name: BuildKit ref
run: |
@@ -166,6 +168,7 @@ jobs:
build-windows:
runs-on: windows-2022
timeout-minutes: 120
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- validate-dco
env:
@@ -188,6 +191,7 @@ jobs:
- name: Env
run: |
Get-ChildItem Env: | Out-String
- name: Moby - Init
run: |
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go-build"
@@ -198,18 +202,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
- name: Cache
uses: actions/cache@v4
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
${{ github.workspace }}\go-build
${{ env.GOPATH }}\pkg\mod
key: ${{ inputs.os }}-${{ github.job }}-${{ hashFiles('**/vendor.sum') }}
restore-keys: |
${{ inputs.os }}-${{ github.job }}-
cache: false
- name: Docker info
run: |
@@ -220,7 +213,6 @@ jobs:
& docker build `
--build-arg WINDOWS_BASE_IMAGE `
--build-arg WINDOWS_BASE_IMAGE_TAG `
--build-arg GO_VERSION `
-t ${{ env.TEST_IMAGE_NAME }} `
-f Dockerfile.windows .
@@ -266,6 +258,7 @@ jobs:
test-windows:
runs-on: windows-2022
timeout-minutes: 120 # guardrails timeout for the whole job
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- build-windows
env:
@@ -309,22 +302,27 @@ jobs:
disabledFeatures="${disabledFeatures},merge_diff"
fi
echo "BUILDKIT_TEST_DISABLE_FEATURES=${disabledFeatures}" >> $GITHUB_ENV
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Checkout
uses: actions/checkout@v4
with:
path: moby
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: vendor.sum
cache: false
- name: BuildKit ref
shell: bash
run: |
echo "$(./hack/buildkit-ref)" >> $GITHUB_ENV
working-directory: moby
- name: Checkout BuildKit ${{ env.BUILDKIT_REF }}
uses: actions/checkout@v4
with:
@@ -359,6 +357,7 @@ jobs:
testFlags="${testFlags} --run=TestIntegration/$testSliceOffset.*/worker=${{ matrix.worker }}"
fi
echo "TESTFLAGS=${testFlags}" >> $GITHUB_ENV
- name: Test
shell: bash
run: |

View File

@@ -67,6 +67,7 @@ jobs:
prepare-cross:
runs-on: ubuntu-24.04
timeout-minutes: 20 # guardrails timeout for the whole job
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- validate-dco
outputs:
@@ -89,6 +90,7 @@ jobs:
cross:
runs-on: ubuntu-24.04
timeout-minutes: 20 # guardrails timeout for the whole job
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- validate-dco
- prepare-cross
@@ -128,6 +130,7 @@ jobs:
govulncheck:
runs-on: ubuntu-24.04
timeout-minutes: 120 # guardrails timeout for the whole job
# Always run security checks, even with 'ci/validate-only' label
permissions:
# required to write sarif report
security-events: write
@@ -157,6 +160,7 @@ jobs:
build-dind:
runs-on: ubuntu-24.04
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- validate-dco
steps:

View File

@@ -32,6 +32,9 @@ on:
# * * * * *
- cron: '0 9 * * 4'
env:
GO_VERSION: "1.24.9"
jobs:
codeql:
runs-on: ubuntu-24.04
@@ -55,10 +58,11 @@ jobs:
run: |
ln -s vendor.mod go.mod
ln -s vendor.sum go.sum
- name: Update Go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24.3"
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:

View File

@@ -23,7 +23,7 @@ on:
pull_request:
env:
GO_VERSION: "1.24.3"
GO_VERSION: "1.24.9"
GIT_PAGER: "cat"
PAGER: "cat"
SETUP_BUILDX_VERSION: edge
@@ -44,6 +44,7 @@ jobs:
mode:
- ""
- systemd
- firewalld
steps:
-
name: Prepare
@@ -65,10 +66,11 @@ jobs:
targets: dev
set: |
*.cache-from=type=gha,scope=dev${{ matrix.mode }}
*.cache-to=type=gha,scope=dev${{ matrix.mode }},mode=max
*.cache-to=type=gha,scope=dev${{ matrix.mode }}
*.output=type=cacheonly
test:
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- build-dev
- validate-dco
@@ -84,6 +86,7 @@ jobs:
storage: ${{ matrix.storage }}
test-unit:
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- build-dev
- validate-dco
@@ -153,6 +156,7 @@ jobs:
smoke-prepare:
runs-on: ubuntu-24.04
timeout-minutes: 10 # guardrails timeout for the whole job
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- validate-dco
outputs:
@@ -175,6 +179,7 @@ jobs:
smoke:
runs-on: ubuntu-24.04
timeout-minutes: 20 # guardrails timeout for the whole job
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- smoke-prepare
strategy:

View File

@@ -14,13 +14,9 @@ concurrency:
cancel-in-progress: true
on:
schedule:
- cron: '0 10 * * *'
workflow_dispatch:
push:
branches:
- 'master'
- '[0-9]+.[0-9]+'
- '[0-9]+.x'
pull_request:
jobs:
validate-dco:
@@ -32,6 +28,7 @@ jobs:
- validate-dco
run:
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- test-prepare
uses: ./.github/workflows/.windows.yml

View File

@@ -1,4 +1,4 @@
name: windows-2019
name: windows-2025
# Default to 'contents: read', which grants actions to read commits.
#
@@ -14,9 +14,13 @@ concurrency:
cancel-in-progress: true
on:
schedule:
- cron: '0 10 * * *'
workflow_dispatch:
push:
branches:
- 'master'
- '[0-9]+.[0-9]+'
- '[0-9]+.x'
pull_request:
jobs:
validate-dco:
@@ -28,6 +32,7 @@ jobs:
- validate-dco
run:
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci/validate-only') }}
needs:
- test-prepare
uses: ./.github/workflows/.windows.yml
@@ -37,6 +42,6 @@ jobs:
matrix:
storage: ${{ fromJson(needs.test-prepare.outputs.matrix) }}
with:
os: windows-2019
os: windows-2025
storage: ${{ matrix.storage }}
send_coverage: false

View File

@@ -3,7 +3,7 @@ version: "2"
run:
# prevent golangci-lint from deducting the go version to lint for through go.mod,
# which causes it to fallback to go1.17 semantics.
go: "1.24.3"
go: "1.24.9"
concurrency: 2
# Only supported with go modules enabled (build flag -mod=vendor only valid when using modules)
# modules-download-mode: vendor
@@ -21,12 +21,14 @@ linters:
- dogsled # Detects assignments with too many blank identifiers.
- dupword # Detects duplicate words.
- durationcheck # Detect cases where two time.Duration values are being multiplied in possibly erroneous ways.
- errorlint # Detects code that will cause problems with the error wrapping scheme introduced in Go 1.13.
- errchkjson # Detects unsupported types passed to json encoding functions and reports if checks for the returned error can be omitted.
- exhaustive # Detects missing options in enum switch statements.
- exptostd # Detects functions from golang.org/x/exp/ that can be replaced by std functions.
- fatcontext # Detects nested contexts in loops and function literals.
- forbidigo
- gocheckcompilerdirectives # Detects invalid go compiler directive comments (//go:).
- gocritic # Detects for bugs, performance and style issues.
- gosec # Detects security problems.
- govet
- iface # Detects incorrect use of interfaces. Currently only used for "identical" interfaces in the same package.
@@ -42,6 +44,7 @@ linters:
- revive # Metalinter; drop-in replacement for golint.
- spancheck # Detects mistakes with OpenTelemetry/Census spans.
- staticcheck
- thelper
- unconvert # Detects unnecessary type conversions.
- unused
- usestdlibvars # Detects the possibility to use variables/constants from the Go standard library.
@@ -73,6 +76,13 @@ linters:
- "false" # some tests use this as expected output
- "root" # for tests using "ls" output with files owned by "root:root"
errorlint:
# Check whether fmt.Errorf uses the %w verb for formatting errors.
# See the https://github.com/polyfloyd/go-errorlint for caveats.
errorf: false
# Check for plain type assertions and type switches.
asserts: false
exhaustive:
# Program elements to check for exhaustiveness.
# Default: [ switch ]
@@ -102,6 +112,56 @@ linters:
msg: Add a wrapper to nlwrap.Handle for EINTR handling and update the list in .golangci.yml.
analyze-types: true
gocritic:
disabled-checks:
- appendAssign
- appendCombine
- assignOp
- builtinShadow
- builtinShadowDecl
- captLocal
- commentedOutCode
- deferInLoop
- dupImport
- dupSubExpr
- elseif
- emptyFallthrough
- equalFold
- evalOrder
- exitAfterDefer
- exposedSyncMutex
- filepathJoin
- hexLiteral
- hugeParam
- ifElseChain
- importShadow
- indexAlloc
- methodExprCall
- nestingReduce
- nilValReturn
- octalLiteral
- paramTypeCombine
- preferStringWriter
- ptrToRefParam
- rangeValCopy
- redundantSprint
- regexpMust
- regexpSimplify
- singleCaseSwitch
- sloppyReassign
- stringXbytes
- typeAssertChain
- typeDefFirst
- typeUnparen
- uncheckedInlineErr
- unlambda
- unnamedResult
- unnecessaryDefer
- unslice
- valSwap
- whyNoLint
enable-all: true
gosec:
excludes:
- G104 # G104: Errors unhandled; (TODO: reduce unhandled errors, or explicitly ignore)
@@ -164,6 +224,30 @@ linters:
- record-error # check that `span.RecordError(err)` is called when an error is returned
- set-status # check that `span.SetStatus(codes.Error, msg)` is called when an error is returned
thelper:
test:
# Check *testing.T is first param (or after context.Context) of helper function.
first: false
# Check t.Helper() begins helper function.
begin: false
benchmark:
# Check *testing.B is first param (or after context.Context) of helper function.
first: false
# Check b.Helper() begins helper function.
begin: false
tb:
# Check *testing.TB is first param (or after context.Context) of helper function.
first: false
# Check *testing.TB param has name tb.
name: false
# Check tb.Helper() begins helper function.
begin: false
fuzz:
# Check *testing.F is first param (or after context.Context) of helper function.
first: false
# Check f.Helper() begins helper function.
begin: false
usestdlibvars:
# Suggest the use of http.MethodXX.
http-method: true
@@ -220,7 +304,7 @@ linters:
- staticcheck
# FIXME(thaJeztah): ignoring these transitional utilities until BuildKit is vendored with https://github.com/moby/moby/pull/49743
- text: "SA1019: idtools\\.(ToUserIdentityMapping|FromUserIdentityMapping) is deprecated"
- text: "SA1019: idtools\\.(ToUserIdentityMapping|FromUserIdentityMapping|IdentityMapping) is deprecated"
linters:
- staticcheck
@@ -250,6 +334,11 @@ linters:
path: "libnetwork/cmd/networkdb-test/dbclient"
linters:
- forbidigo
# Ignore deprecated disk usage type warnings which will be moved internal to the daemon backend in the next major release.
- text: "SA1019: ((buildtypes|build).CacheDiskUsage|(container|containertypes|image|volume|volumetypes).DiskUsage) is deprecated"
linters:
- staticcheck
# Log a warning if an exclusion rule is unused.
# Default: false

View File

@@ -83,6 +83,39 @@ contributions, see [the advanced contribution
section](https://docs.docker.com/opensource/workflow/advanced-contributing/) in
the contributors guide.
### Where to put your changes
You can make changes to any Go package within Moby outside of the vendor directory. There are no
restrictions on packages but a few guidelines to follow for deciding on making these changes.
When adding new packages, first consider putting them in an internal directory to prevent
unintended importing from other modules. Code changes should either go under `api`, `client`,
or `daemon` modules, or one of the integration test directories.
Try to put a new package under the appropriate directories. The root directory is reserved for
configuration and build files, no source files will be accepted in the root.
- `api` - All types shared by client and daemon along with swagger definitions.
- `client` - All Go files for the docker client
- `contrib` - Files, configurations, and packages related to external tools or libraries
- `daemon` - All Go files and packages for building the daemon
- `docs` - All Moby technical documentation using markdown
- `hack` - All scripts used for testing, development, and CI
- `integration` - Testing the integration of the API, client, and daemon
- `integration-cli` - Deprecated integration tests of the docker cli with the daemon, no new tests allowed
- `pkg` - Legacy Go packages used externally, no new packages should be added here
- `project` - All files related to Moby project governance
- `vendor` - Autogenerated vendor files from `make vendor` command, do not manually edit files here
The daemon module has many subpackages. Consider putting new packages under one of these
directories.
- `daemon/cmd` - All Go main packages and the packages used only for that main package
- `daemon/internal` - All utility packages used by daemon and not intended for external use
- `daemon/man`- All Moby reference manuals used for the `man` command
- `daemon/plugins` - All included daemon plugins which are intended to be registered via init
- `daemon/pkg` - All libraries used by daemon and for integration testing
- `daemon/version` - Version package with the current daemon version
### Connect with other Moby Project contributors
<table class="tg">

View File

@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG GO_VERSION=1.24.3
ARG GO_VERSION=1.24.9
ARG BASE_DEBIAN_DISTRO="bookworm"
ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"
ARG XX_VERSION=1.6.1
@@ -10,7 +10,7 @@ ARG XX_VERSION=1.6.1
ARG VPNKIT_VERSION=0.6.0
# DOCKERCLI_VERSION is the version of the CLI to install in the dev-container.
ARG DOCKERCLI_VERSION=v28.2.0-rc.2
ARG DOCKERCLI_VERSION=v28.2.2
ARG DOCKERCLI_REPOSITORY="https://github.com/docker/cli.git"
# cli version used for integration-cli tests
@@ -171,7 +171,7 @@ RUN git init . && git remote add origin "https://github.com/containerd/container
# When updating the binary version you may also need to update the vendor
# version to pick up bug fixes or new APIs, however, usually the Go packages
# are built from a commit from the master branch.
ARG CONTAINERD_VERSION=v1.7.27
ARG CONTAINERD_VERSION=v1.7.29
RUN git fetch -q --depth 1 origin "${CONTAINERD_VERSION}" +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD
FROM base AS containerd-build
@@ -209,7 +209,8 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
&& /build/golangci-lint --version
FROM base AS gotestsum
ARG GOTESTSUM_VERSION=v1.12.0
# GOTESTSUM_VERSION is the version of gotest.tools/gotestsum to install.
ARG GOTESTSUM_VERSION=v1.12.3
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
GOBIN=/build/ GO111MODULE=on go install "gotest.tools/gotestsum@${GOTESTSUM_VERSION}" \
@@ -259,9 +260,8 @@ WORKDIR /usr/src/runc
RUN git init . && git remote add origin "https://github.com/opencontainers/runc.git"
# RUNC_VERSION should match the version that is used by the containerd version
# that is used. If you need to update runc, open a pull request in the containerd
# project first, and update both after that is merged. When updating RUNC_VERSION,
# consider updating runc in vendor.mod accordingly.
ARG RUNC_VERSION=v1.2.6
# project first, and update both after that is merged.
ARG RUNC_VERSION=v1.3.3
RUN git fetch -q --depth 1 origin "${RUNC_VERSION}" +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD
FROM base AS runc-build

View File

@@ -5,7 +5,7 @@
# This represents the bare minimum required to build and test Docker.
ARG GO_VERSION=1.24.3
ARG GO_VERSION=1.24.9
ARG BASE_DEBIAN_DISTRO="bookworm"
ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"

View File

@@ -161,12 +161,14 @@ FROM ${WINDOWS_BASE_IMAGE}:${WINDOWS_BASE_IMAGE_TAG}
# Use PowerShell as the default shell
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ARG GO_VERSION=1.24.3
ARG GOTESTSUM_VERSION=v1.12.0
ARG GO_VERSION=1.24.9
# GOTESTSUM_VERSION is the version of gotest.tools/gotestsum to install.
ARG GOTESTSUM_VERSION=v1.12.3
# GOWINRES_VERSION is the version of go-winres to install.
ARG GOWINRES_VERSION=v0.3.3
ARG CONTAINERD_VERSION=v1.7.27
ARG CONTAINERD_VERSION=v1.7.29
# Environment variable notes:
# - GO_VERSION must be consistent with 'Dockerfile' used by Linux.
@@ -257,14 +259,11 @@ RUN `
Remove-Item C:\gitsetup.zip; `
`
Write-Host INFO: Downloading containerd; `
Install-Package -Force 7Zip4PowerShell; `
$location='https://github.com/containerd/containerd/releases/download/'+$Env:CONTAINERD_VERSION+'/containerd-'+$Env:CONTAINERD_VERSION.TrimStart('v')+'-windows-amd64.tar.gz'; `
Download-File $location C:\containerd.tar.gz; `
New-Item -Path C:\containerd -ItemType Directory; `
Expand-7Zip C:\containerd.tar.gz C:\; `
Expand-7Zip C:\containerd.tar C:\containerd; `
tar -xzf C:\containerd.tar.gz -C C:\containerd; `
Remove-Item C:\containerd.tar.gz; `
Remove-Item C:\containerd.tar; `
`
# Ensure all directories exist that we will require below....
$srcDir = """$Env:GOPATH`\src\github.com\docker\docker\bundles"""; `

View File

@@ -203,7 +203,7 @@ build: shell_target := --target=dev-base
else
build: shell_target := --target=dev
endif
build: bundles
build: validate-bind-dir bundles
$(BUILD_CMD) $(BUILD_OPTS) $(shell_target) --load -t "$(DOCKER_IMAGE)" .
.PHONY: shell
@@ -284,3 +284,10 @@ generate-files:
--file "./hack/dockerfiles/generate-files.Dockerfile" .
cp -R "$($@_TMP_OUT)"/. .
rm -rf "$($@_TMP_OUT)"/*
.PHONY: validate-bind-dir
validate-bind-dir:
@case "$(BIND_DIR)" in \
".."*|"/"*) echo "Make needs to be run from the project-root directory, with BIND_DIR set to \".\" or a subdir"; \
exit 1 ;; \
esac

View File

@@ -121,6 +121,6 @@ automatically set the other above mentioned environment variables accordingly.
You can change a version of golang used for building stuff that is being tested
by setting `GO_VERSION` variable, for example:
```
make GO_VERSION=1.12.8 test
```bash
make GO_VERSION=1.24.8 test
```

View File

@@ -1,9 +1,9 @@
package api // import "github.com/docker/docker/api"
package api
// Common constants for daemon and client.
const (
// DefaultVersion of the current REST API.
DefaultVersion = "1.50"
DefaultVersion = "1.51"
// MinSupportedAPIVersion is the minimum API version that can be supported
// by the API server, specified as "major.minor". Note that the daemon

View File

@@ -1,4 +1,4 @@
package build // import "github.com/docker/docker/api/server/backend/build"
package build
import (
"context"

View File

@@ -1,4 +1,4 @@
package build // import "github.com/docker/docker/api/server/backend/build"
package build
import (
"context"

View File

@@ -1,4 +1,4 @@
package httpstatus // import "github.com/docker/docker/api/server/httpstatus"
package httpstatus
import (
"context"

View File

@@ -1,4 +1,4 @@
package httputils // import "github.com/docker/docker/api/server/httputils"
package httputils
import (
"io"

View File

@@ -1,4 +1,4 @@
package httputils // import "github.com/docker/docker/api/server/httputils"
package httputils
import (
"encoding/json"

View File

@@ -1,4 +1,4 @@
package httputils // import "github.com/docker/docker/api/server/httputils"
package httputils
import (
"math"
@@ -30,7 +30,7 @@ func TestBoolValue(t *testing.T) {
for c, e := range cases {
v := url.Values{}
v.Set("test", c)
r, _ := http.NewRequest(http.MethodPost, "", nil)
r, _ := http.NewRequest(http.MethodPost, "", http.NoBody)
r.Form = v
a := BoolValue(r, "test")
@@ -41,14 +41,14 @@ func TestBoolValue(t *testing.T) {
}
func TestBoolValueOrDefault(t *testing.T) {
r, _ := http.NewRequest(http.MethodGet, "", nil)
r, _ := http.NewRequest(http.MethodGet, "", http.NoBody)
if !BoolValueOrDefault(r, "queryparam", true) {
t.Fatal("Expected to get true default value, got false")
}
v := url.Values{}
v.Set("param", "")
r, _ = http.NewRequest(http.MethodGet, "", nil)
r, _ = http.NewRequest(http.MethodGet, "", http.NoBody)
r.Form = v
if BoolValueOrDefault(r, "param", true) {
t.Fatal("Expected not to get true")
@@ -66,7 +66,7 @@ func TestInt64ValueOrZero(t *testing.T) {
for c, e := range cases {
v := url.Values{}
v.Set("test", c)
r, _ := http.NewRequest(http.MethodPost, "", nil)
r, _ := http.NewRequest(http.MethodPost, "", http.NoBody)
r.Form = v
a := Int64ValueOrZero(r, "test")
@@ -86,7 +86,7 @@ func TestInt64ValueOrDefault(t *testing.T) {
for c, e := range cases {
v := url.Values{}
v.Set("test", c)
r, _ := http.NewRequest(http.MethodPost, "", nil)
r, _ := http.NewRequest(http.MethodPost, "", http.NoBody)
r.Form = v
a, err := Int64ValueOrDefault(r, "test", -1)
@@ -102,7 +102,7 @@ func TestInt64ValueOrDefault(t *testing.T) {
func TestInt64ValueOrDefaultWithError(t *testing.T) {
v := url.Values{}
v.Set("test", "invalid")
r, _ := http.NewRequest(http.MethodPost, "", nil)
r, _ := http.NewRequest(http.MethodPost, "", http.NoBody)
r.Form = v
_, err := Int64ValueOrDefault(r, "test", -1)
@@ -150,7 +150,7 @@ func TestUint32Value(t *testing.T) {
}
for _, tc := range tests {
t.Run(tc.value, func(t *testing.T) {
r, _ := http.NewRequest(http.MethodPost, "", nil)
r, _ := http.NewRequest(http.MethodPost, "", http.NoBody)
r.Form = url.Values{}
if tc.value != valueNotSet {
r.Form.Set("field", tc.value)

View File

@@ -1,4 +1,4 @@
package httputils // import "github.com/docker/docker/api/server/httputils"
package httputils
import (
"context"
@@ -74,7 +74,7 @@ func ReadJSON(r *http.Request, out interface{}) error {
err = dec.Decode(out)
defer r.Body.Close()
if err != nil {
if err == io.EOF {
if errors.Is(err, io.EOF) {
return errdefs.InvalidParameter(errors.New("invalid JSON: got EOF while reading request body"))
}
return errdefs.InvalidParameter(errors.Wrap(err, "invalid JSON"))

View File

@@ -1,4 +1,4 @@
package httputils // import "github.com/docker/docker/api/server/httputils"
package httputils
import (
"net/http"
@@ -33,7 +33,7 @@ func TestJsonContentType(t *testing.T) {
func TestReadJSON(t *testing.T) {
t.Run("nil body", func(t *testing.T) {
req, err := http.NewRequest(http.MethodPost, "https://example.com/some/path", nil)
req, err := http.NewRequest(http.MethodPost, "https://example.com/some/path", http.NoBody)
if err != nil {
t.Error(err)
}

View File

@@ -1,4 +1,4 @@
package httputils // import "github.com/docker/docker/api/server/httputils"
package httputils
import (
"context"
@@ -11,10 +11,13 @@ import (
"github.com/docker/docker/api/types/backend"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/stdcopy"
)
// rfc3339NanoFixed is time.RFC3339Nano with nanoseconds padded using zeros to
// ensure the formatted time isalways the same number of characters.
const rfc3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00"
// WriteLogStream writes an encoded byte stream of log messages from the
// messages channel, multiplexing them with a stdcopy.Writer if mux is true
func WriteLogStream(_ context.Context, w http.ResponseWriter, msgs <-chan *backend.LogMessage, config *container.LogsOptions, mux bool) {
@@ -53,7 +56,7 @@ func WriteLogStream(_ context.Context, w http.ResponseWriter, msgs <-chan *backe
logLine = append(logLine, msg.Line...)
}
if config.Timestamps {
logLine = append([]byte(msg.Timestamp.Format(jsonmessage.RFC3339NanoFixed)+" "), logLine...)
logLine = append([]byte(msg.Timestamp.Format(rfc3339NanoFixed)+" "), logLine...)
}
if msg.Source == "stdout" && config.ShowStdout {
_, _ = outStream.Write(logLine)

View File

@@ -1,4 +1,4 @@
package server // import "github.com/docker/docker/api/server"
package server
import (
"github.com/containerd/log"

View File

@@ -1,4 +1,4 @@
package middleware // import "github.com/docker/docker/api/server/middleware"
package middleware
import (
"bufio"

View File

@@ -1,4 +1,4 @@
package middleware // import "github.com/docker/docker/api/server/middleware"
package middleware
import (
"testing"

View File

@@ -1,4 +1,4 @@
package middleware // import "github.com/docker/docker/api/server/middleware"
package middleware
import (
"context"

View File

@@ -1,4 +1,4 @@
package middleware // import "github.com/docker/docker/api/server/middleware"
package middleware
import (
"context"

View File

@@ -1,4 +1,4 @@
package middleware // import "github.com/docker/docker/api/server/middleware"
package middleware
import (
"context"

View File

@@ -1,4 +1,4 @@
package middleware // import "github.com/docker/docker/api/server/middleware"
package middleware
import (
"context"
@@ -79,7 +79,7 @@ func TestVersionMiddlewareVersion(t *testing.T) {
assert.NilError(t, err)
h := m.WrapHandler(handler)
req, _ := http.NewRequest(http.MethodGet, "/containers/json", nil)
req, _ := http.NewRequest(http.MethodGet, "/containers/json", http.NoBody)
resp := httptest.NewRecorder()
ctx := context.Background()
@@ -121,7 +121,7 @@ func TestVersionMiddlewareVersion(t *testing.T) {
func TestVersionMiddlewareWithErrorsReturnsHeaders(t *testing.T) {
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
v := httputils.VersionFromContext(ctx)
assert.Check(t, len(v) != 0)
assert.Check(t, v != "")
return nil
}
@@ -129,7 +129,7 @@ func TestVersionMiddlewareWithErrorsReturnsHeaders(t *testing.T) {
assert.NilError(t, err)
h := m.WrapHandler(handler)
req, _ := http.NewRequest(http.MethodGet, "/containers/json", nil)
req, _ := http.NewRequest(http.MethodGet, "/containers/json", http.NoBody)
resp := httptest.NewRecorder()
ctx := context.Background()

View File

@@ -1,4 +1,4 @@
package build // import "github.com/docker/docker/api/server/router/build"
package build
import (
"context"

View File

@@ -1,4 +1,4 @@
package build // import "github.com/docker/docker/api/server/router/build"
package build
import (
"runtime"

View File

@@ -1,4 +1,4 @@
package build // import "github.com/docker/docker/api/server/router/build"
package build
import (
"bufio"

View File

@@ -1,4 +1,4 @@
package checkpoint // import "github.com/docker/docker/api/server/router/checkpoint"
package checkpoint
import "github.com/docker/docker/api/types/checkpoint"

View File

@@ -1,4 +1,4 @@
package checkpoint // import "github.com/docker/docker/api/server/router/checkpoint"
package checkpoint
import (
"github.com/docker/docker/api/server/httputils"

View File

@@ -1,4 +1,4 @@
package checkpoint // import "github.com/docker/docker/api/server/router/checkpoint"
package checkpoint
import (
"context"
@@ -38,6 +38,9 @@ func (cr *checkpointRouter) getContainerCheckpoints(ctx context.Context, w http.
if err != nil {
return err
}
if checkpoints == nil {
checkpoints = []checkpoint.Summary{}
}
return httputils.WriteJSON(w, http.StatusOK, checkpoints)
}

View File

@@ -1,4 +1,4 @@
package container // import "github.com/docker/docker/api/server/router/container"
package container
import (
"context"

View File

@@ -1,4 +1,4 @@
package container // import "github.com/docker/docker/api/server/router/container"
package container
import (
"github.com/docker/docker/api/server/httputils"

View File

@@ -1,4 +1,4 @@
package container // import "github.com/docker/docker/api/server/router/container"
package container
import (
"context"
@@ -531,7 +531,7 @@ func (c *containerRouter) postContainersCreate(ctx context.Context, w http.Respo
}
// Ignore KernelMemoryTCP because it was added in API 1.40.
hostConfig.KernelMemoryTCP = 0
hostConfig.KernelMemoryTCP = 0 //nolint:staticcheck // ignore SA1019 This field is still used for legacy support.
// Older clients (API < 1.40) expects the default to be shareable, make them happy
if hostConfig.IpcMode.IsEmpty() {

View File

@@ -1,4 +1,4 @@
package container // import "github.com/docker/docker/api/server/router/container"
package container
import (
"compress/flate"

View File

@@ -1,4 +1,4 @@
package container // import "github.com/docker/docker/api/server/router/container"
package container
import (
"context"

View File

@@ -1,7 +1,7 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.23
package container // import "github.com/docker/docker/api/server/router/container"
package container
import (
"context"

View File

@@ -1,4 +1,4 @@
package debug // import "github.com/docker/docker/api/server/router/debug"
package debug
import (
"context"

View File

@@ -1,4 +1,4 @@
package debug // import "github.com/docker/docker/api/server/router/debug"
package debug
import (
"context"

View File

@@ -1,4 +1,4 @@
package distribution // import "github.com/docker/docker/api/server/router/distribution"
package distribution
import (
"context"

View File

@@ -1,4 +1,4 @@
package distribution // import "github.com/docker/docker/api/server/router/distribution"
package distribution
import "github.com/docker/docker/api/server/router"

View File

@@ -1,4 +1,4 @@
package distribution // import "github.com/docker/docker/api/server/router/distribution"
package distribution
import (
"context"
@@ -108,14 +108,14 @@ func (dr *distributionRouter) fetchManifest(ctx context.Context, distrepo distri
}
mnfst, err := mnfstsrvc.Get(ctx, distributionInspect.Descriptor.Digest)
if err != nil {
switch err {
case reference.ErrReferenceInvalidFormat,
reference.ErrTagInvalidFormat,
reference.ErrDigestInvalidFormat,
reference.ErrNameContainsUppercase,
reference.ErrNameEmpty,
reference.ErrNameTooLong,
reference.ErrNameNotCanonical:
switch {
case errors.Is(err, reference.ErrReferenceInvalidFormat),
errors.Is(err, reference.ErrTagInvalidFormat),
errors.Is(err, reference.ErrDigestInvalidFormat),
errors.Is(err, reference.ErrNameContainsUppercase),
errors.Is(err, reference.ErrNameEmpty),
errors.Is(err, reference.ErrNameTooLong),
errors.Is(err, reference.ErrNameNotCanonical):
return registry.DistributionInspect{}, errdefs.InvalidParameter(err)
}
return registry.DistributionInspect{}, err

View File

@@ -1,4 +1,4 @@
package router // import "github.com/docker/docker/api/server/router"
package router
import (
"context"

View File

@@ -1,4 +1,4 @@
package grpc // import "github.com/docker/docker/api/server/router/grpc"
package grpc
import "google.golang.org/grpc"

View File

@@ -1,7 +1,7 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.23
package grpc // import "github.com/docker/docker/api/server/router/grpc"
package grpc
import (
"context"

View File

@@ -1,4 +1,4 @@
package grpc // import "github.com/docker/docker/api/server/router/grpc"
package grpc
import (
"context"

View File

@@ -1,4 +1,4 @@
package image // import "github.com/docker/docker/api/server/router/image"
package image
import (
"context"

View File

@@ -1,4 +1,4 @@
package image // import "github.com/docker/docker/api/server/router/image"
package image
import (
"github.com/docker/docker/api/server/router"

View File

@@ -1,4 +1,4 @@
package image // import "github.com/docker/docker/api/server/router/image"
package image
import (
"context"
@@ -15,7 +15,6 @@ import (
"github.com/docker/docker/api"
"github.com/docker/docker/api/server/httputils"
"github.com/docker/docker/api/types/backend"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
imagetypes "github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/registry"
@@ -27,8 +26,6 @@ import (
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/progress"
"github.com/docker/docker/pkg/streamformatter"
"github.com/docker/go-connections/nat"
dockerspec "github.com/moby/docker-image-spec/specs-go/v1"
"github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
@@ -103,6 +100,8 @@ func (ir *imageRouter) postImagesCreate(ctx context.Context, w http.ResponseWrit
// For a pull it is not an error if no auth was given. Ignore invalid
// AuthConfig to increase compatibility with the existing API.
//
// TODO(thaJeztah): accept empty values but return an error when failing to decode.
authConfig, _ := registry.DecodeAuthConfig(r.Header.Get(registry.AuthHeader))
progressErr = ir.backend.PullImage(ctx, ref, platform, metaHeaders, authConfig, output)
} else { // import
@@ -113,7 +112,7 @@ func (ir *imageRouter) postImagesCreate(ctx context.Context, w http.ResponseWrit
return errdefs.InvalidParameter(err)
}
if len(comment) == 0 {
if comment == "" {
comment = "Imported from " + src
}
@@ -168,19 +167,11 @@ func (ir *imageRouter) postImagesPush(ctx context.Context, w http.ResponseWriter
return err
}
var authConfig *registry.AuthConfig
if authEncoded := r.Header.Get(registry.AuthHeader); authEncoded != "" {
// the new format is to handle the authConfig as a header. Ignore invalid
// AuthConfig to increase compatibility with the existing API.
authConfig, _ = registry.DecodeAuthConfig(authEncoded)
} else {
// the old format is supported for compatibility if there was no authConfig header
var err error
authConfig, err = registry.DecodeAuthConfigBody(r.Body)
if err != nil {
return errors.Wrap(err, "bad parameters and missing X-Registry-Auth")
}
}
// Handle the authConfig as a header, but ignore invalid AuthConfig
// to increase compatibility with the existing API.
//
// TODO(thaJeztah): accept empty values but return an error when failing to decode.
authConfig, _ := registry.DecodeAuthConfig(r.Header.Get(registry.AuthHeader))
output := ioutils.NewWriteFlusher(w)
defer output.Close()
@@ -370,7 +361,7 @@ func (ir *imageRouter) getImagesByName(ctx context.Context, w http.ResponseWrite
return errdefs.InvalidParameter(errors.New("conflicting options: manifests and platform options cannot both be set"))
}
imageInspect, err := ir.backend.ImageInspect(ctx, vars["name"], backend.ImageInspectOpts{
resp, err := ir.backend.ImageInspect(ctx, vars["name"], backend.ImageInspectOpts{
Manifests: manifests,
Platform: platform,
})
@@ -378,6 +369,14 @@ func (ir *imageRouter) getImagesByName(ctx context.Context, w http.ResponseWrite
return err
}
// inspectResponse preserves fields in the response that have an
// "omitempty" in the OCI spec, but didn't omit such fields in
// legacy responses before API v1.50.
imageInspect := &inspectCompatResponse{
InspectResponse: resp,
legacyConfig: legacyConfigFields["current"],
}
// Make sure we output empty arrays instead of nil. While Go nil slice is functionally equivalent to an empty slice,
// it matters for the JSON representation.
if imageInspect.RepoTags == nil {
@@ -405,14 +404,7 @@ func (ir *imageRouter) getImagesByName(ctx context.Context, w http.ResponseWrite
imageInspect.Descriptor = nil
}
if versions.LessThan(version, "1.50") {
type imageInspectLegacy struct {
imagetypes.InspectResponse
LegacyConfig *container.Config `json:"Config"`
}
return httputils.WriteJSON(w, http.StatusOK, imageInspectLegacy{
InspectResponse: *imageInspect,
LegacyConfig: dockerOCIImageConfigToContainerConfig(*imageInspect.Config),
})
imageInspect.legacyConfig = legacyConfigFields["v1.49"]
}
return httputils.WriteJSON(w, http.StatusOK, imageInspect)
@@ -461,6 +453,7 @@ func (ir *imageRouter) getImagesJSON(ctx context.Context, w http.ResponseWriter,
useNone := versions.LessThan(version, "1.43")
withVirtualSize := versions.LessThan(version, "1.44")
noDescriptor := versions.LessThan(version, "1.48")
noContainers := versions.LessThan(version, "1.51")
for _, img := range images {
if useNone {
if len(img.RepoTags) == 0 && len(img.RepoDigests) == 0 {
@@ -481,6 +474,9 @@ func (ir *imageRouter) getImagesJSON(ctx context.Context, w http.ResponseWriter,
if noDescriptor {
img.Descriptor = nil
}
if noContainers {
img.Containers = -1
}
}
return httputils.WriteJSON(w, http.StatusOK, images)
@@ -598,27 +594,3 @@ func validateRepoName(name reference.Named) error {
}
return nil
}
// FIXME(thaJeztah): this is a copy of dockerOCIImageConfigToContainerConfig in daemon/containerd: https://github.com/moby/moby/blob/6b617699c500522aa6526cfcae4558333911b11f/daemon/containerd/imagespec.go#L107-L128
func dockerOCIImageConfigToContainerConfig(cfg dockerspec.DockerOCIImageConfig) *container.Config {
exposedPorts := make(nat.PortSet, len(cfg.ExposedPorts))
for k, v := range cfg.ExposedPorts {
exposedPorts[nat.Port(k)] = v
}
return &container.Config{
Entrypoint: cfg.Entrypoint,
Env: cfg.Env,
Cmd: cfg.Cmd,
User: cfg.User,
WorkingDir: cfg.WorkingDir,
ExposedPorts: exposedPorts,
Volumes: cfg.Volumes,
Labels: cfg.Labels,
ArgsEscaped: cfg.ArgsEscaped, //nolint:staticcheck // Ignore SA1019. Need to keep it in image.
StopSignal: cfg.StopSignal,
Healthcheck: cfg.Healthcheck,
OnBuild: cfg.OnBuild,
Shell: cfg.Shell,
}
}

View File

@@ -0,0 +1,88 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.23
package image
import (
"encoding/json"
"maps"
"github.com/docker/docker/api/types/image"
)
// legacyConfigFields defines legacy image-config fields to include in
// API responses on older API versions.
var legacyConfigFields = map[string]map[string]any{
// Legacy fields for API v1.49 and lower. These fields are deprecated
// and omitted in newer API versions; see https://github.com/moby/moby/pull/48457
"v1.49": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": nil,
"Domainname": "",
"Entrypoint": nil,
"Env": nil,
"Hostname": "",
"Image": "",
"Labels": nil,
"OnBuild": nil,
"OpenStdin": false,
"StdinOnce": false,
"Tty": false,
"User": "",
"Volumes": nil,
"WorkingDir": "",
},
// Legacy fields for current API versions (v1.50 and up). These fields
// did not have an "omitempty" and were always included in the response,
// even if not set; see https://github.com/moby/moby/issues/50134
"current": {
"Cmd": nil,
"Entrypoint": nil,
"Env": nil,
"Labels": nil,
"OnBuild": nil,
"User": "",
"Volumes": nil,
"WorkingDir": "",
},
}
// inspectCompatResponse is a wrapper around [image.InspectResponse] with a
// custom marshal function for legacy [api/types/container.Config} fields
// that have been removed, or did not have omitempty.
type inspectCompatResponse struct {
*image.InspectResponse
legacyConfig map[string]any
}
// MarshalJSON implements a custom marshaler to include legacy fields
// in API responses.
func (ir *inspectCompatResponse) MarshalJSON() ([]byte, error) {
type tmp *image.InspectResponse
base, err := json.Marshal((tmp)(ir.InspectResponse))
if err != nil {
return nil, err
}
if len(ir.legacyConfig) == 0 {
return base, nil
}
type resp struct {
*image.InspectResponse
Config map[string]any
}
var merged resp
err = json.Unmarshal(base, &merged)
if err != nil {
return base, nil
}
// prevent mutating legacyConfigFields.
cfg := maps.Clone(ir.legacyConfig)
maps.Copy(cfg, merged.Config)
merged.Config = cfg
return json.Marshal(merged)
}

View File

@@ -0,0 +1,74 @@
package image
import (
"encoding/json"
"testing"
"github.com/docker/docker/api/types/image"
dockerspec "github.com/moby/docker-image-spec/specs-go/v1"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
)
func TestInspectResponse(t *testing.T) {
tests := []struct {
doc string
cfg *ocispec.ImageConfig
legacyConfig map[string]any
expected string
}{
{
doc: "empty",
expected: `null`,
},
{
doc: "no legacy config",
cfg: &ocispec.ImageConfig{
Cmd: []string{"/bin/sh"},
StopSignal: "SIGQUIT",
},
expected: `{"Cmd":["/bin/sh"],"StopSignal":"SIGQUIT"}`,
},
{
doc: "api < v1.50",
cfg: &ocispec.ImageConfig{
Cmd: []string{"/bin/sh"},
StopSignal: "SIGQUIT",
},
legacyConfig: legacyConfigFields["v1.49"],
expected: `{"AttachStderr":false,"AttachStdin":false,"AttachStdout":false,"Cmd":["/bin/sh"],"Domainname":"","Entrypoint":null,"Env":null,"Hostname":"","Image":"","Labels":null,"OnBuild":null,"OpenStdin":false,"StdinOnce":false,"StopSignal":"SIGQUIT","Tty":false,"User":"","Volumes":null,"WorkingDir":""}`,
},
{
doc: "api >= v1.50",
cfg: &ocispec.ImageConfig{
Cmd: []string{"/bin/sh"},
StopSignal: "SIGQUIT",
},
legacyConfig: legacyConfigFields["current"],
expected: `{"Cmd":["/bin/sh"],"Entrypoint":null,"Env":null,"Labels":null,"OnBuild":null,"StopSignal":"SIGQUIT","User":"","Volumes":null,"WorkingDir":""}`,
},
}
for _, tc := range tests {
t.Run(tc.doc, func(t *testing.T) {
imgInspect := &image.InspectResponse{}
if tc.cfg != nil {
// Verify that fields that are set override the legacy values,
// or appended if not part of the legacy values.
imgInspect.Config = &dockerspec.DockerOCIImageConfig{
ImageConfig: *tc.cfg,
}
}
out, err := json.Marshal(&inspectCompatResponse{
InspectResponse: imgInspect,
legacyConfig: tc.legacyConfig,
})
assert.NilError(t, err)
var outMap struct{ Config json.RawMessage }
err = json.Unmarshal(out, &outMap)
assert.NilError(t, err)
assert.Check(t, is.Equal(string(outMap.Config), tc.expected))
})
}
}

View File

@@ -1,4 +1,4 @@
package router // import "github.com/docker/docker/api/server/router"
package router
import (
"net/http"

View File

@@ -1,4 +1,4 @@
package network // import "github.com/docker/docker/api/server/router/network"
package network
import (
"context"

View File

@@ -1,4 +1,4 @@
package network // import "github.com/docker/docker/api/server/router/network"
package network
import (
"github.com/docker/docker/api/server/router"

View File

@@ -1,4 +1,4 @@
package network // import "github.com/docker/docker/api/server/router/network"
package network
import (
"context"

View File

@@ -1,4 +1,4 @@
package plugin // import "github.com/docker/docker/api/server/router/plugin"
package plugin
import (
"context"

View File

@@ -1,4 +1,4 @@
package plugin // import "github.com/docker/docker/api/server/router/plugin"
package plugin
import "github.com/docker/docker/api/server/router"

View File

@@ -1,4 +1,4 @@
package plugin // import "github.com/docker/docker/api/server/router/plugin"
package plugin
import (
"context"

View File

@@ -1,4 +1,4 @@
package router // import "github.com/docker/docker/api/server/router"
package router
import "github.com/docker/docker/api/server/httputils"

View File

@@ -1,4 +1,4 @@
package session // import "github.com/docker/docker/api/server/router/session"
package session
import (
"context"

View File

@@ -1,4 +1,4 @@
package session // import "github.com/docker/docker/api/server/router/session"
package session
import "github.com/docker/docker/api/server/router"

View File

@@ -1,4 +1,4 @@
package session // import "github.com/docker/docker/api/server/router/session"
package session
import (
"context"

View File

@@ -1,4 +1,4 @@
package swarm // import "github.com/docker/docker/api/server/router/swarm"
package swarm
import (
"context"

View File

@@ -1,4 +1,4 @@
package swarm // import "github.com/docker/docker/api/server/router/swarm"
package swarm
import "github.com/docker/docker/api/server/router"

View File

@@ -1,4 +1,4 @@
package swarm // import "github.com/docker/docker/api/server/router/swarm"
package swarm
import (
"context"

View File

@@ -1,4 +1,4 @@
package swarm // import "github.com/docker/docker/api/server/router/swarm"
package swarm
import (
"context"

View File

@@ -1,4 +1,4 @@
package swarm // import "github.com/docker/docker/api/server/router/swarm"
package swarm
import (
"reflect"

View File

@@ -1,10 +1,11 @@
package system // import "github.com/docker/docker/api/server/router/system"
package system
import (
"context"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/backend"
"github.com/docker/docker/api/types/build"
"github.com/docker/docker/api/types/events"
"github.com/docker/docker/api/types/filters"
@@ -13,24 +14,12 @@ import (
"github.com/docker/docker/api/types/system"
)
// DiskUsageOptions holds parameters for system disk usage query.
type DiskUsageOptions struct {
// Containers controls whether container disk usage should be computed.
Containers bool
// Images controls whether image disk usage should be computed.
Images bool
// Volumes controls whether volume disk usage should be computed.
Volumes bool
}
// Backend is the methods that need to be implemented to provide
// system specific functionality.
type Backend interface {
SystemInfo(context.Context) (*system.Info, error)
SystemVersion(context.Context) (types.Version, error)
SystemDiskUsage(ctx context.Context, opts DiskUsageOptions) (*system.DiskUsage, error)
SystemDiskUsage(ctx context.Context, opts backend.DiskUsageOptions) (*backend.DiskUsage, error)
SubscribeToEvents(since, until time.Time, ef filters.Args) ([]events.Message, chan interface{})
UnsubscribeFromEvents(chan interface{})
AuthenticateToRegistry(ctx context.Context, authConfig *registry.AuthConfig) (string, string, error)

View File

@@ -1,7 +1,7 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.23
package system // import "github.com/docker/docker/api/server/router/system"
package system
import (
"github.com/docker/docker/api/server/router"

View File

@@ -1,7 +1,7 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.23
package system // import "github.com/docker/docker/api/server/router/system"
package system
import (
"context"
@@ -14,6 +14,7 @@ import (
"github.com/docker/docker/api/server/httputils"
"github.com/docker/docker/api/server/router/build"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/backend"
buildtypes "github.com/docker/docker/api/types/build"
"github.com/docker/docker/api/types/events"
"github.com/docker/docker/api/types/filters"
@@ -183,11 +184,11 @@ func (s *systemRouter) getDiskUsage(ctx context.Context, w http.ResponseWriter,
eg, ctx := errgroup.WithContext(ctx)
var systemDiskUsage *system.DiskUsage
var systemDiskUsage *backend.DiskUsage
if getContainers || getImages || getVolumes {
eg.Go(func() error {
var err error
systemDiskUsage, err = s.backend.SystemDiskUsage(ctx, DiskUsageOptions{
systemDiskUsage, err = s.backend.SystemDiskUsage(ctx, backend.DiskUsageOptions{
Containers: getContainers,
Images: getImages,
Volumes: getVolumes,
@@ -238,7 +239,7 @@ func (s *systemRouter) getDiskUsage(ctx context.Context, w http.ResponseWriter,
}
}
du := system.DiskUsage{}
du := backend.DiskUsage{}
if getBuildCache {
du.BuildCache = &buildtypes.CacheDiskUsage{
TotalSize: builderSize,

View File

@@ -1,4 +1,4 @@
package volume // import "github.com/docker/docker/api/server/router/volume"
package volume
import (
"context"

View File

@@ -1,4 +1,4 @@
package volume // import "github.com/docker/docker/api/server/router/volume"
package volume
import "github.com/docker/docker/api/server/router"

View File

@@ -1,4 +1,4 @@
package volume // import "github.com/docker/docker/api/server/router/volume"
package volume
import (
"context"

View File

@@ -22,7 +22,7 @@ import (
func callGetVolume(v *volumeRouter, name string) (*httptest.ResponseRecorder, error) {
ctx := context.WithValue(context.Background(), httputils.APIVersionKey{}, clusterVolumesVersion)
vars := map[string]string{"name": name}
req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/volumes/%s", name), nil)
req := httptest.NewRequest(http.MethodGet, fmt.Sprintf("/volumes/%s", name), http.NoBody)
resp := httptest.NewRecorder()
err := v.getVolumeByName(ctx, resp, req, vars)
@@ -32,7 +32,7 @@ func callGetVolume(v *volumeRouter, name string) (*httptest.ResponseRecorder, er
func callListVolumes(v *volumeRouter) (*httptest.ResponseRecorder, error) {
ctx := context.WithValue(context.Background(), httputils.APIVersionKey{}, clusterVolumesVersion)
vars := map[string]string{}
req := httptest.NewRequest(http.MethodGet, "/volumes", nil)
req := httptest.NewRequest(http.MethodGet, "/volumes", http.NoBody)
resp := httptest.NewRecorder()
err := v.getVolumesList(ctx, resp, req, vars)
@@ -428,7 +428,7 @@ func TestVolumeRemove(t *testing.T) {
}
ctx := context.WithValue(context.Background(), httputils.APIVersionKey{}, clusterVolumesVersion)
req := httptest.NewRequest(http.MethodDelete, "/volumes/vol1", nil)
req := httptest.NewRequest(http.MethodDelete, "/volumes/vol1", http.NoBody)
resp := httptest.NewRecorder()
err := v.deleteVolumes(ctx, resp, req, map[string]string{"name": "vol1"})
@@ -455,7 +455,7 @@ func TestVolumeRemoveSwarm(t *testing.T) {
}
ctx := context.WithValue(context.Background(), httputils.APIVersionKey{}, clusterVolumesVersion)
req := httptest.NewRequest(http.MethodDelete, "/volumes/vol1", nil)
req := httptest.NewRequest(http.MethodDelete, "/volumes/vol1", http.NoBody)
resp := httptest.NewRecorder()
err := v.deleteVolumes(ctx, resp, req, map[string]string{"name": "vol1"})
@@ -472,7 +472,7 @@ func TestVolumeRemoveNotFoundNoSwarm(t *testing.T) {
}
ctx := context.WithValue(context.Background(), httputils.APIVersionKey{}, clusterVolumesVersion)
req := httptest.NewRequest(http.MethodDelete, "/volumes/vol1", nil)
req := httptest.NewRequest(http.MethodDelete, "/volumes/vol1", http.NoBody)
resp := httptest.NewRecorder()
err := v.deleteVolumes(ctx, resp, req, map[string]string{"name": "vol1"})
@@ -489,7 +489,7 @@ func TestVolumeRemoveNotFoundNoManager(t *testing.T) {
}
ctx := context.WithValue(context.Background(), httputils.APIVersionKey{}, clusterVolumesVersion)
req := httptest.NewRequest(http.MethodDelete, "/volumes/vol1", nil)
req := httptest.NewRequest(http.MethodDelete, "/volumes/vol1", http.NoBody)
resp := httptest.NewRecorder()
err := v.deleteVolumes(ctx, resp, req, map[string]string{"name": "vol1"})
@@ -513,7 +513,7 @@ func TestVolumeRemoveFoundNoSwarm(t *testing.T) {
}
ctx := context.WithValue(context.Background(), httputils.APIVersionKey{}, clusterVolumesVersion)
req := httptest.NewRequest(http.MethodDelete, "/volumes/vol1", nil)
req := httptest.NewRequest(http.MethodDelete, "/volumes/vol1", http.NoBody)
resp := httptest.NewRecorder()
err := v.deleteVolumes(ctx, resp, req, map[string]string{"name": "vol1"})
@@ -536,7 +536,7 @@ func TestVolumeRemoveNoSwarmInUse(t *testing.T) {
}
ctx := context.WithValue(context.Background(), httputils.APIVersionKey{}, clusterVolumesVersion)
req := httptest.NewRequest(http.MethodDelete, "/volumes/inuse", nil)
req := httptest.NewRequest(http.MethodDelete, "/volumes/inuse", http.NoBody)
resp := httptest.NewRecorder()
err := v.deleteVolumes(ctx, resp, req, map[string]string{"name": "inuse"})
@@ -564,7 +564,7 @@ func TestVolumeRemoveSwarmForce(t *testing.T) {
}
ctx := context.WithValue(context.Background(), httputils.APIVersionKey{}, clusterVolumesVersion)
req := httptest.NewRequest(http.MethodDelete, "/volumes/vol1", nil)
req := httptest.NewRequest(http.MethodDelete, "/volumes/vol1", http.NoBody)
resp := httptest.NewRecorder()
err := v.deleteVolumes(ctx, resp, req, map[string]string{"name": "vol1"})
@@ -573,7 +573,7 @@ func TestVolumeRemoveSwarmForce(t *testing.T) {
assert.Assert(t, cerrdefs.IsConflict(err))
ctx = context.WithValue(context.Background(), httputils.APIVersionKey{}, clusterVolumesVersion)
req = httptest.NewRequest(http.MethodDelete, "/volumes/vol1?force=1", nil)
req = httptest.NewRequest(http.MethodDelete, "/volumes/vol1?force=1", http.NoBody)
resp = httptest.NewRecorder()
err = v.deleteVolumes(ctx, resp, req, map[string]string{"name": "vol1"})

View File

@@ -1,4 +1,4 @@
package server // import "github.com/docker/docker/api/server"
package server
import (
"context"

View File

@@ -1,4 +1,4 @@
package server // import "github.com/docker/docker/api/server"
package server
import (
"context"
@@ -21,7 +21,7 @@ func TestMiddlewares(t *testing.T) {
}
srv.UseMiddleware(*m)
req, _ := http.NewRequest(http.MethodGet, "/containers/json", nil)
req, _ := http.NewRequest(http.MethodGet, "/containers/json", http.NoBody)
resp := httptest.NewRecorder()
ctx := context.Background()

View File

@@ -19,10 +19,10 @@ produces:
consumes:
- "application/json"
- "text/plain"
basePath: "/v1.50"
basePath: "/v1.51"
info:
title: "Docker Engine API"
version: "1.50"
version: "1.51"
x-logo:
url: "https://docs.docker.com/assets/images/logo-docker-main.png"
description: |
@@ -56,7 +56,7 @@ info:
is returned.
If you omit the version-prefix, the current version of the API (v1.50) is used.
For example, calling `/info` is the same as calling `/v1.50/info`. Using the
For example, calling `/info` is the same as calling `/v1.51/info`. Using the
API without a version-prefix is deprecated and will be removed in a future release.
Engine releases in the near future should support this version of the API,
@@ -81,7 +81,6 @@ info:
{
"username": "string",
"password": "string",
"email": "string",
"serveraddress": "string"
}
```
@@ -637,6 +636,9 @@ definitions:
by the default (runc) runtime.
This field is omitted when empty.
**Deprecated**: This field is deprecated as kernel 6.12 has deprecated `memory.kmem.tcp.limit_in_bytes` field
for cgroups v1. This field will be removed in a future release.
type: "integer"
format: "int64"
MemoryReservation:
@@ -1531,37 +1533,6 @@ definitions:
items:
type: "string"
example: ["/bin/sh", "-c"]
# FIXME(thaJeztah): temporarily using a full example to remove some "omitempty" fields. Remove once the fields are removed.
example:
"User": "web:web"
"ExposedPorts": {
"80/tcp": {},
"443/tcp": {}
}
"Env": ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"]
"Cmd": ["/bin/sh"]
"Healthcheck": {
"Test": ["string"],
"Interval": 0,
"Timeout": 0,
"Retries": 0,
"StartPeriod": 0,
"StartInterval": 0
}
"ArgsEscaped": true
"Volumes": {
"/app/data": {},
"/app/config": {}
}
"WorkingDir": "/public/"
"Entrypoint": []
"OnBuild": []
"Labels": {
"com.example.some-label": "some-value",
"com.example.some-other-label": "some-other-value"
}
"StopSignal": "SIGTERM"
"Shell": ["/bin/sh", "-c"]
NetworkingConfig:
description: |
@@ -1608,6 +1579,8 @@ definitions:
Bridge:
description: |
Name of the default bridge interface when dockerd's --bridge flag is set.
Deprecated: This field is only set when the daemon is started with the --bridge flag specified.
type: "string"
example: "docker0"
SandboxID:
@@ -1965,6 +1938,11 @@ definitions:
Depending on how the image was created, this field may be empty and
is only set for images that were built/created locally. This field
is empty if the image was pulled from an image registry.
> **Deprecated**: This field is only set when using the deprecated
> legacy builder. It is included in API responses for informational
> purposes, but should not be depended on as it will be omitted
> once the legacy builder is removed.
type: "string"
x-nullable: false
example: ""
@@ -1990,6 +1968,11 @@ definitions:
The version of Docker that was used to build the image.
Depending on how the image was created, this field may be empty.
> **Deprecated**: This field is only set when using the deprecated
> legacy builder. It is included in API responses for informational
> purposes, but should not be depended on as it will be omitted
> once the legacy builder is removed.
type: "string"
x-nullable: false
example: "27.0.1"
@@ -2034,14 +2017,6 @@ definitions:
format: "int64"
x-nullable: false
example: 1239828
VirtualSize:
description: |
Total size of the image including all layers it is composed of.
Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead.
type: "integer"
format: "int64"
example: 1239828
GraphDriver:
$ref: "#/definitions/DriverData"
RootFS:
@@ -2174,14 +2149,6 @@ definitions:
format: "int64"
x-nullable: false
example: 1239828
VirtualSize:
description: |-
Total size of the image including all layers it is composed of.
Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead.
type: "integer"
format: "int64"
example: 172064416
Labels:
description: "User-defined key/value metadata."
type: "object"
@@ -2196,8 +2163,7 @@ definitions:
Number of containers using this image. Includes both stopped and running
containers.
This size is not calculated by default, and depends on which API endpoint
is used. `-1` indicates that the value has not been set / calculated.
`-1` indicates that the value has not been set / calculated.
x-nullable: false
type: "integer"
example: 2
@@ -2235,6 +2201,10 @@ definitions:
password:
type: "string"
email:
description: |
Email is an optional value associated with the username.
> **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release.
type: "string"
serveraddress:
type: "string"
@@ -2683,14 +2653,6 @@ definitions:
description: |
Unique ID of the build cache record.
example: "ndlpt0hhvkqcdfkputsk4cq9c"
Parent:
description: |
ID of the parent build cache record.
> **Deprecated**: This field is deprecated, and omitted if empty.
type: "string"
x-nullable: true
example: ""
Parents:
description: |
List of parent build cache record IDs.
@@ -2914,7 +2876,8 @@ definitions:
be used. If multiple endpoints have the same priority, endpoints are
lexicographically sorted based on their network name, and the one
that sorts first is picked.
type: "number"
type: "integer"
format: "int64"
example:
- 10
@@ -3171,10 +3134,15 @@ definitions:
- Args
properties:
DockerVersion:
description: "Docker Version used to create the plugin"
description: |-
Docker Version used to create the plugin.
Depending on how the plugin was created, this field may be empty or omitted.
Deprecated: this field is no longer set, and will be removed in the next API version.
type: "string"
x-nullable: false
example: "17.06.0-ce"
x-omitempty: true
Description:
type: "string"
x-nullable: false
@@ -4392,6 +4360,7 @@ definitions:
A counter that triggers an update even if no relevant parameters have
been changed.
type: "integer"
format: "uint64"
Runtime:
description: |
Runtime is the type of runtime specified for the task executor.
@@ -5863,7 +5832,7 @@ definitions:
type: "integer"
format: "uint64"
x-nullable: true
example: 18446744073709551615
example: "18446744073709551615"
ContainerThrottlingData:
description: |
@@ -6375,6 +6344,8 @@ definitions:
Kernel memory TCP limits are not supported when using cgroups v2, which
does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup.
**Deprecated**: This field is deprecated as kernel 6.12 has deprecated kernel memory TCP accounting.
type: "boolean"
example: true
CpuCfsPeriod:
@@ -6412,29 +6383,6 @@ definitions:
description: "Indicates IPv4 forwarding is enabled."
type: "boolean"
example: true
BridgeNfIptables:
description: |
Indicates if `bridge-nf-call-iptables` is available on the host when
the daemon was started.
<p><br /></p>
> **Deprecated**: netfilter module is now loaded on-demand and no longer
> during daemon startup, making this field obsolete. This field is always
> `false` and will be removed in a API v1.49.
type: "boolean"
example: false
BridgeNfIp6tables:
description: |
Indicates if `bridge-nf-call-ip6tables` is available on the host.
<p><br /></p>
> **Deprecated**: netfilter module is now loaded on-demand, and no longer
> during daemon startup, making this field obsolete. This field is always
> `false` and will be removed in a API v1.49.
type: "boolean"
example: false
Debug:
description: |
Indicates if the daemon is running in debug-mode / with debug-level

View File

@@ -1,4 +1,4 @@
package {{ .Package }} // import "github.com/docker/docker/api/types/{{ .Package }}"
package {{ .Package }}
// ----------------------------------------------------------------------------
// Code generated by `swagger generate operation`. DO NOT EDIT.

View File

@@ -1,5 +1,5 @@
// Package backend includes types to send information to server backends.
package backend // import "github.com/docker/docker/api/types/backend"
package backend
import (
"io"

View File

@@ -1,4 +1,4 @@
package backend // import "github.com/docker/docker/api/types/backend"
package backend
import (
"io"

View File

@@ -0,0 +1,29 @@
package backend
import (
"github.com/docker/docker/api/types/build"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/volume"
)
// DiskUsageOptions holds parameters for system disk usage query.
type DiskUsageOptions struct {
// Containers controls whether container disk usage should be computed.
Containers bool
// Images controls whether image disk usage should be computed.
Images bool
// Volumes controls whether volume disk usage should be computed.
Volumes bool
}
// DiskUsage contains the information returned by the backend for the
// GET "/system/df" endpoint.
type DiskUsage struct {
Images *image.DiskUsage
Containers *container.DiskUsage
Volumes *volume.DiskUsage
BuildCache *build.CacheDiskUsage
}

View File

@@ -1,4 +1,4 @@
package blkiodev // import "github.com/docker/docker/api/types/blkiodev"
package blkiodev
import "fmt"

View File

@@ -1,6 +1,8 @@
package build
// CacheDiskUsage contains disk usage for the build cache.
//
// Deprecated: this type is no longer used and will be removed in the next release.
type CacheDiskUsage struct {
TotalSize int64
Reclaimable int64

View File

@@ -1,4 +1,4 @@
package types // import "github.com/docker/docker/api/types"
package types
import (
"bufio"

View File

@@ -1,4 +1,4 @@
package container // import "github.com/docker/docker/api/types/container"
package container
import (
"time"

View File

@@ -1,6 +1,8 @@
package container
// DiskUsage contains disk usage for containers.
//
// Deprecated: this type is no longer used and will be removed in the next release.
type DiskUsage struct {
TotalSize int64
Reclaimable int64

View File

@@ -18,11 +18,13 @@ type ExecOptions struct {
AttachStdin bool // Attach the standard input, makes possible user interaction
AttachStderr bool // Attach the standard error
AttachStdout bool // Attach the standard output
Detach bool // Execute in detach mode
DetachKeys string // Escape keys for detach
Env []string // Environment variables
WorkingDir string // Working directory
Cmd []string // Execution commands and args
// Deprecated: the Detach field is not used, and will be removed in a future release.
Detach bool
}
// ExecStartOptions is a temp struct used by execStart

View File

@@ -1,4 +1,4 @@
package container // import "github.com/docker/docker/api/types/container"
package container
import (
"errors"
@@ -394,7 +394,12 @@ type Resources struct {
// KernelMemory specifies the kernel memory limit (in bytes) for the container.
// Deprecated: kernel 5.4 deprecated kmem.limit_in_bytes.
KernelMemory int64 `json:",omitempty"`
KernelMemory int64 `json:",omitempty"`
// Hard limit for kernel TCP buffer memory (in bytes).
//
// Deprecated: This field is deprecated and will be removed in the next release.
// Starting with 6.12, the kernel has deprecated kernel memory tcp accounting
// for cgroups v1.
KernelMemoryTCP int64 `json:",omitempty"` // Hard limit for kernel TCP buffer memory (in bytes)
MemoryReservation int64 // Memory soft limit (in bytes)
MemorySwap int64 // Total memory usage (memory + swap); set `-1` to enable unlimited swap

View File

@@ -1,6 +1,6 @@
//go:build !windows
package container // import "github.com/docker/docker/api/types/container"
package container
import "github.com/docker/docker/api/types/network"

View File

@@ -1,4 +1,4 @@
package container // import "github.com/docker/docker/api/types/container"
package container
import "github.com/docker/docker/api/types/network"

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