Commit Graph

3217 Commits

Author SHA1 Message Date
Paweł Gronowski
0f597561e8 hack/test/unit: Fix api and client module testing without replace rules
Running sub-package tests from the root module without readding the
replace rules wasn't running the tests from the local in-tree versions
of these submodules.

Fix by cd-ing into their directories before running tests.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-12 21:38:59 +01:00
Sebastiaan van Stijn
b74e6fefba Merge pull request #51469 from thaJeztah/daemon_rm_deadcode
remove some dead code
2025-11-11 15:01:02 +01:00
Sebastiaan van Stijn
7c29edf1b4 hack: remove cpexp package
This looks to have been accidentally committed in
1b1608f2cd

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-11 09:37:43 +01:00
Austin Vazquez
365e588d0f Dockerfile: update containerd binary to v2.2.0 (static binaries and CI only)
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-11-10 21:06:12 -05:00
Paweł Gronowski
922cd97491 update to go1.25.4
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-06 14:15:23 +01:00
Austin Vazquez
c351539358 Dockerfile: test containerd v2.1.5 (linux), v2.0.7 (windows)
Update the version of containerd used in CI and for static binaries
to v2.1.5 (linux) and v2.0.7 (windows)

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-11-05 19:11:57 -06:00
Austin Vazquez
fabdccbe10 api/types: move disk usage structs to per type packages
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-11-05 11:20:15 -06:00
Paweł Gronowski
97524fa4d4 Merge pull request #51397 from vvoland/vendor-buildkit
vendor: github.com/moby/buildkit v0.25.2
2025-11-05 14:13:55 +01:00
Sebastiaan van Stijn
b075a393b1 Merge pull request #51235 from austinvazquez/refactor-client-system
api/types/system: deprecate `DiskUsage.*` fields and add type specific fields
2025-11-05 14:02:50 +01:00
Paweł Gronowski
39f2dbffa1 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>
2025-11-05 13:09:29 +01:00
Paweł Gronowski
35f6a78082 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>
2025-11-05 10:57:28 +01:00
Austin Vazquez
a69abdd90d api/types/system: add type specific usage fields to DiskUsage
This change adds type specific fields to `GET /system/df` endpoint with high level information of disk usage. This change also introduces `verbose` query to the endpoint so that detailed information is by default excluded unless queried to reduce memory consumption. The previous top level `DiskUsage` fields (`Images`, `Containers`, `Volumes` and `BuildCache`) are now deprecated and kept for backwards compatibility.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-11-03 16:34:26 -06:00
Paweł Gronowski
1e56b87f7f hack/vendor: Make dropreplace vendor latest version
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-31 17:24:21 +01:00
Sebastiaan van Stijn
6aea8c2591 Dockerfile: update integration-cli CLI to v25.0.5
Now that we're raising the minimum API version, we can also update
the CLI used in our integration-cli tests.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-31 09:22:40 +01:00
Paweł Gronowski
7a97e1cb40 Merge pull request #51334 from thaJeztah/rename_auth
api/types/registry: rename AuthenticateOKBody to AuthResponse
2025-10-29 23:51:39 +01:00
Sebastiaan van Stijn
0eba2989e0 api/types/registry: rename AuthenticateOKBody to AuthResponse
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 18:06:29 +01:00
Sebastiaan van Stijn
90e7232c8e Dockerfile: update runc binary to v1.3.2
Update the version used in CI and for the static binaries.

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 14:38:17 +01:00
Austin Vazquez
bae45f766d api/types/network: define ConnectRequest and DisconnectRequest
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-29 11:44:18 +01:00
Sebastiaan van Stijn
68e1a8805b Dockerfile: test against containerd v2.1.4
Update the version of containerd used in CI and for static binaries
to v2.1.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-21 08:55:48 -05:00
Sebastiaan van Stijn
35acf347eb hack: disable go telemetry in integration tests
commit 081987b647 updated the Dockerfile
to disable go's telemetry in our dev / test-environment; as collecting
this data doesn't serve much purpose.

However, the configuration to disable telemetry is tied to the user's
home-directory (HOME); and disabling telemetry writs a config-file to the
user's home-directory (`~/.config/go/telemetry/mode`). While go provides
env-vars about the mode and location (`GOTELEMETRY` and `GOTELEMETRYDIR`),
those env-vars are read-only and cannot be used to either disable telemetry
or to set the location;

> Information about telemetry configuration is also available via read-only Go environment variables:
>
>  go env GOTELEMETRY reports the telemetry mode.
> go env GOTELEMETRYDIR reports the directory holding telemetry configuration and data.

Some steps in our CI set up a different home-directory, which is not configured
to disable telemetry, which means that CI currently leaves behind a bunch of
files related to this;

    make TEST_FILTER=TestPruneDontDeleteUsedDangling test-integration
    tree -a bundles/test-integration/fake-HOME/
    bundles/test-integration/fake-HOME/
    └── .config
        └── go
            └── telemetry
                ├── local
                │   ├── asm@go1.25.3-go1.25.3-linux-arm64-2025-10-21.v1.count
                │   ├── compile@go1.25.3-go1.25.3-linux-arm64-2025-10-21.v1.count
                │   ├── go@go1.25.3-go1.25.3-linux-arm64-2025-10-21.v1.count
                │   ├── link@go1.25.3-go1.25.3-linux-arm64-2025-10-21.v1.count
                │   ├── test2json@go1.25.3-go1.25.3-linux-arm64-2025-10-21.v1.count
                │   ├── upload.token
                │   └── weekends
                └── upload

    6 directories, 7 files

This patch disables go telemetry also for this home-directory to prevent
those files from being created, and to prevent go from producing the
telemetry.

With this patch, only the file to disable telemetry is produced:

    make TEST_FILTER=TestPruneDontDeleteUsedDangling test-integration
    tree -a bundles/test-integration/fake-HOME/
    bundles/test-integration/fake-HOME/
    └── .config
        └── go
            └── telemetry
                └── mode

    4 directories, 1 file

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-21 12:17:30 +02:00
Austin Vazquez
42ba5466c7 api: rename volumes.CreateOptions to volumes.CreateRequest
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-20 13:23:41 -05:00
Sebastiaan van Stijn
acda47637c ci: update docker-py to main (v7.2.0-dev)
full diff: https://github.com/docker/docker-py/compare/7.1.0...65f7f0c772577beb5e2cd6daac4e5ca806ccc4af

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-17 18:46:44 +02:00
Sebastiaan van Stijn
c5abafb459 Merge pull request #51186 from thaJeztah/deprecate_api_v1.43
daemon: raise default minimum API version to v1.44
2025-10-16 17:40:54 +02:00
Paweł Gronowski
acfe4e8613 gha: add support for docker-v* tags
ci(bin-image): strip prefix for bin-image tags

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-16 14:26:10 +02:00
Sebastiaan van Stijn
2c59be7011 daemon: raise default minimum API version to v1.44
- relates to 96b29f5a1f
- similar to 08e4e88482

The daemon currently provides support for API versions all the way back
to v1.24, which is the version of the API that shipped with docker 1.12.0
(released in 2016).

Such old versions of the client are rare, and supporting older API versions
has accumulated significant amounts of code to remain backward-compatible
(which is largely untested, and a "best-effort" at most).

This patch updates the minimum API version to v1.44, matching the minimum
version of the client, and matching the API version of docker v25.0, which
is the oldest supported version (through Mirantis MCR).

The intent is to start deprecating older API versions when daemons implementing
them reach EOL. This patch does not yet remove backward-compatibility code
for older API versions, and the DOCKER_MIN_API_VERSION environment variable
allows overriding the minimum version (to allow restoring the behavior from
before this patch), however, API versions below v1.44 should be considered
"best effort", and we may remove compatibility code to provide "degraded"
support.

With this patch the daemon defaults to API v1.44 as minimum:

    docker version
    Client:
     Version:           28.5.0
     API version:       1.51
     Go version:        go1.24.7
     Git commit:        887030f
     Built:             Thu Oct  2 14:54:39 2025
     OS/Arch:           linux/arm64
     Context:           default

    Server:
     Engine:
      Version:          dev
      API version:      1.52 (minimum version 1.44)
    ....

Trying to use an older version of the API produces an error:

    DOCKER_API_VERSION=1.43 docker version
    Client:
     Version:           28.5.0
     API version:       1.43 (downgraded from 1.51)
     Go version:        go1.24.7
     Git commit:        887030f
     Built:             Thu Oct  2 14:54:39 2025
     OS/Arch:           linux/arm64
     Context:           default
    Error response from daemon: client version 1.43 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version

To restore the previous minimum, users can start the daemon with the
DOCKER_MIN_API_VERSION environment variable set:

    DOCKER_MIN_API_VERSION=1.24 dockerd

API 1.24 is the oldest supported API version;

    docker version
    Client:
     Version:           28.5.0
     API version:       1.24 (downgraded from 1.51)
     Go version:        go1.24.7
     Git commit:        887030f
     Built:             Thu Oct  2 14:54:39 2025
     OS/Arch:           linux/arm64
     Context:           default

    Server:
     Engine:
      Version:          dev
      API version:      1.52 (minimum version 1.24)
    ....

When using the `DOCKER_MIN_API_VERSION` with a version of the API that
is not supported, an error is produced when starting the daemon;

    DOCKER_MIN_API_VERSION=1.23 dockerd --validate
    invalid DOCKER_MIN_API_VERSION: minimum supported API version is 1.24: 1.23

    DOCKER_MIN_API_VERSION=1.99 dockerd --validate
    invalid DOCKER_MIN_API_VERSION: maximum supported API version is 1.52: 1.99

Specifying a malformed API version also produces the same error;

    DOCKER_MIN_API_VERSION=hello dockerd --validate
    invalid DOCKER_MIN_API_VERSION: minimum supported API version is 1.24: hello

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-14 23:42:12 +02:00
Paweł Gronowski
1aa73144f2 update to go1.25.3
This release addresses breakage caused by a security patch included in
Go 1.25.2 and 1.24.8, which enforced overly restrictive validation on
the parsing of X.509 certificates. We've removed those restrictions
while maintaining the security fix that the initial release addressed.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-14 09:11:27 +02:00
Sebastiaan van Stijn
28018a51d8 update to go1.25.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-11 20:14:22 +02:00
Austin Vazquez
258f340a46 Merge pull request #51136 from tonistiigi/update-buildkit-v0.25.1
vendor: update buildkit to v0.25.1
2025-10-07 17:59:35 -07:00
Tonis Tiigi
1b1608f2cd hack: add patch to buildkit tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-10-07 16:51:15 -07:00
Paweł Gronowski
0aed907a86 update to go1.24.8
This minor release includes 10 security fixes following the security policy:

- net/mail: excessive CPU consumption in ParseAddress

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

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

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

- crypto/x509: quadratic complexity when checking name constraints

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

    This affects programs which validate arbitrary certificate chains.

    Thanks to Jakub Ciolek for reporting this issue.

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

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

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

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

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

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

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

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

    This affects programs which parse untrusted PEM inputs.

    Thanks to Jakub Ciolek for reporting this issue.

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

- net/url: insufficient validation of bracketed IPv6 hostnames

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

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

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

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

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

    Thanks to Jakub Ciolek for reporting this issue.

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

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

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

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

    Thanks to jub0bs for reporting this issue.

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

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

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

    This affects programs which validate arbitrary certificate chains.

    Thanks to Jakub Ciolek for reporting this issue.

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

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

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

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

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

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

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

    Thanks to Jakub Ciolek for reporting this issue.

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

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-07 15:49:36 -05:00
Austin Vazquez
f6e1bf2808 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>
2025-10-06 14:43:30 -05:00
Sebastiaan van Stijn
e5a66cb6d6 Merge pull request #51093 from austinvazquez/add-check-for-missing-go-sum
Add existence check for go.mod and go.sum files
2025-10-04 00:00:22 +02:00
Cory Snider
a90adb6dc1 api/types/network: use netip types as appropriate
And generate the ServiceInfo struct from the Swagger spec.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-10-03 21:39:14 +02:00
Austin Vazquez
0ad35e3ef0 Add existence check for go.mod and go.sum files
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-03 08:00:49 -05:00
Jonathan A. Sternberg
3f3bbe4430 vendor: github.com/moby/buildkit v0.25.0
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-01 11:29:07 +02:00
Sebastiaan van Stijn
9b0c78e7d8 Merge pull request #50857 from austinvazquez/add-container-inspect-storage-driver
Add container inspect storage field
2025-09-27 00:49:07 +02:00
Austin Vazquez
efa077848f api/types/storage: define generic Storage type for container inspect
This change defines the generic `Storage` type for use in container inspect responses when using containerd snapshotter backend.

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-09-26 14:21:43 -05:00
Tonis Tiigi
e8d3609031 hack: use custom ref for buildkit tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-24 13:19:48 +02:00
Cory Snider
cf243b64aa daemon: fix build after revendoring api module
Complete the removal of the deprecated network structs by dropping the
remaining references in daemon code.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-09-11 17:47:27 -04:00
Cory Snider
3f86797d3f api,daemon: report IPAM status for network
On API v1.52 and newer, the GET /networks/{id} endpoint returns
statistics about the IPAM state for the subnets assigned to the network.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-09-10 11:06:05 -04:00
Cory Snider
e656f39952 api/t/network: generate more structs from Swagger
Replace hand-rolled struct definitions for api/types/network with
types generated from the Swagger definitions:
  - ConfigReference
  - EndpointResource
  - NetworkingConfig
  - PeerInfo
  - ServiceInfo
  - Task

Add Swagger definitions for ServiceInfo and Task.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-09-04 19:46:44 -04:00
Cory Snider
ea1c2530da api/t/network: generate Inspect, Summary structs
Replace the hand-rolled Network, Summary and Inspect struct types in
api/types/network with types generated from the Swagger definition.

Disable the generation of all unwanted marshalers and unmarshalers.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-09-04 19:46:43 -04:00
Sebastiaan van Stijn
0bfc33c70b Merge pull request #50856 from corhere/swagger-gen-script-cleanup
hack: use heredocs in generate-swagger-api.sh
2025-09-04 20:59:06 +02:00
Paweł Gronowski
ac2d830587 Merge pull request #50889 from vvoland/update-go
update to go1.24.7
2025-09-03 22:18:06 +02:00
Paweł Gronowski
30406d42e3 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>
2025-09-03 20:31:17 +02:00
Kevin Alvarez
d47b0db4f9 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>
2025-09-03 18:41:21 +02:00
Paweł Gronowski
64b8770d90 Merge pull request #50861 from akerouanton/firewalld-debug-logs
hack/dind-systemd: enable, collect firewalld debug logs
2025-09-02 11:32:11 +02:00
CrazyMax
60fa39d559 hack: temporarily use custom buildkit ref for testing
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-09-01 14:51:39 +02:00
Albin Kerouanton
5682f65cca hack/dind-systemd: collect firewalld logs
Add a systemd service 'collect-firewalld-logs.service' that copies
firewalld log file into bundles/ on container shutdown. This won't
provide much value for developers who run `make shell`, but it'll be
useful on CI to include firewalld logs in the exported artifacts.

The CI is already configured to pick every *.log file from bundles/, so
no further change is needed on that side.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-01 11:45:58 +02:00
Albin Kerouanton
03df89b84a hack/dind-systemd: enable firewalld debug logs
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-01 11:44:48 +02:00