4561 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
5b8ef1aff2 api: remove redundant //go:build lines
These are no longer neeeded now that it's a go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-22 15:49:55 +02:00
Muhammad Daffa Dinaya
6e7a2c830d Add Health attribute on the docker ps command
Signed-off-by: Muhammad Daffa Dinaya <muhammaddaffadinaya@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-21 22:57:03 +02:00
Sebastiaan van Stijn
20d594fb79 deprecate pkg/stdcopy, move to api/stdcopy
The stdcopy package is used to produce and read multiplexed streams for
"attach" and "logs". It is used both by the API server (to produce), and
the client (to read / de-multiplex).

Move it to the api package, so that it can be included in the api module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-21 21:41:39 +02:00
Derek McGowan
afd6487b2e Create github.com/moby/moby/api module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-21 09:30:05 -07:00
Sebastiaan van Stijn
18e463a082 api/types: remove deprecated RequestPrivilegeFunc type
This was added in bb899c654a,
which shipped in the latest v28.x releases, so we can remove these.

This removes the `RequestPrivilegeFunc` type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:56:56 +02:00
Sebastiaan van Stijn
a3920ae6a0 api/types: remove deprecated IDResponse type
This was added in b99b5422b0,
which shipped in the latest v28.x releases, so we can remove these.

This removes the `IDResponse` type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:55:38 +02:00
Sebastiaan van Stijn
3e5a06179e api/types: remove deprecated container-inspect types
This was added in 1abc8f6158,
which shipped in the latest v28.x releases, so we can remove these.

This removes the `ContainerJSONBase`, `ContainerJSON` types.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:53:25 +02:00
Sebastiaan van Stijn
8347b05435 api/types: remove deprecated Container type
This was added in 05b0e653dd,
which shipped in the latest v28.x releases, so we can remove these.

This removes the Container type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:50:56 +02:00
Sebastiaan van Stijn
f050df0329 api/types: remove deprecated ContainerState type
This was added in 84ffc644ef,
which shipped in the latest v28.x releases, so we can remove these.

This removes the ContainerState type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:50:06 +02:00
Sebastiaan van Stijn
7abeb4d5a4 api/types: remove deprecated container-networksettings types
This was added in df22a511cb,
which shipped in the latest v28.x releases, so we can remove these.

This removes the NetworkSettings, NetworkSettingsBase, DefaultNetworkSettings,
and SummaryNetworkSettings types.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:49:03 +02:00
Sebastiaan van Stijn
c5a2194b5d api/types: remove deprecated container Health types
This was added in c130ce1f5d,
which shipped in the latest v28.x releases, so we can remove these.

This removes the `Health` and `HealthcheckResult` types to the container package,
as well as the related `NoHealthcheck`, `Starting`, `Healthy`, and `Unhealthy`
consts.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:46:37 +02:00
Sebastiaan van Stijn
76bf0e2929 api/types: remove deprecated MountPoint
These was added in 5517322cf9,
which shipped in the latest v28.x releases, so we can remove these.

This removes the deprecated `api/types.MountPoint`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:44:12 +02:00
Sebastiaan van Stijn
207db8792e api/types: remove deprecated Port
These was added in e12b7493b9,
which shipped in the latest v28.x releases, so we can remove these.

This removes the deprecated `api/types.Port`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:43:11 +02:00
Sebastiaan van Stijn
fa8177ba7a api/types: remove deprecated GraphDriverData
These was added in da039ca918,
which shipped in the latest v28.x releases, so we can remove these.

This removes the deprecated `api/types.GraphDriverData`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:41:42 +02:00
Sebastiaan van Stijn
836ec65d5f api/types: remove deprecated ImageInspect, RootFS
These was added in 7053007f71,
which shipped in the latest v28.x releases, so we can remove these.

This removes the deprecated `api/types.ImageInspect` and
`RootFS`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:39:58 +02:00
Sebastiaan van Stijn
7d3459e7fb api/types: remove deprecated SecretCreateResponse, SecretListOptions
These was added in 23117afca8,
which shipped in the latest v28.x releases, so we can remove these.

This removes the deprecated `api/types.SecretCreateResponse` and
`SecretListOptions`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:38:02 +02:00
Sebastiaan van Stijn
68744c8b05 api/types: remove deprecated ConfigCreateResponse, ConfigListOptions
These was added in a411a39be0,
which shipped in the latest v28.x releases, so we can remove these.

This removes the deprecated `api/types.ConfigCreateResponse` and
`ConfigListOptions`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:36:58 +02:00
Sebastiaan van Stijn
33f07ff3f4 api/types: remove deprecated NodeListOptions, NodeRemoveOptions
These was added in f008d85edc,
which shipped in the latest v28.x releases, so we can remove these.

This removes the deprecated `api/types.NodeListOptions` and
`NodeRemoveOptions`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:35:06 +02:00
Sebastiaan van Stijn
f13796d2af api/types: remove deprecated TaskListOptions
These was added in 5ad0867236,
which shipped in the latest v28.x releases, so we can remove these.

This removes the deprecated `api/types.TaskListOptions`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:33:43 +02:00
Sebastiaan van Stijn
72b1e11264 api/types: remove deprecated ServiceCreateOptions
These aliases were added in 31d62930f7,
which shipped in the latest v28.x releases, so we can remove these.

This removes the deprecated `api/types.ServiceCreateOptions`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:32:13 +02:00
Sebastiaan van Stijn
3faead6fc1 api/types: remove deprecated ServiceUpdateOptions
These aliases were added in 0b1c7a8306,
which shipped in the latest v28.x releases, so we can remove these.

This removes the deprecated `api/types`;

- `ServiceUpdateOptions`
- `RegistryAuthFromSpec`
- `RegistryAuthFromPreviousSpec`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:30:56 +02:00
Sebastiaan van Stijn
55ad118eaf api/types: remove deprecated ServiceListOptions, ServiceInspectOptions
These aliases were added in b13528522a,
which shipped in the latest v28.x releases, so we can remove this.

This removes the deprecated `api/types.ServiceListOptions` and
`api/types.ServiceInspectOptions` types.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:29:07 +02:00
Sebastiaan van Stijn
91558ae3f3 api/types: remove deprecated SwarmUnlockKeyResponse
This alias was added in 7e8f630bec,
which shipped in the latest v28.x releases, so we can remove this.

This removes the deprecated `api/types.SwarmUnlockKeyResponse` type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:26:54 +02:00
Sebastiaan van Stijn
74fe646ac2 api/types: remove deprecated build-cache types
These aliases were added in eefe68a37c,
which shipped in the latest v28.x releases, so we can remove these.

This removes the deprecated `api/types`;

- `BuildCache`
- `BuildCachePruneOptions`
- `BuildCachePruneReport`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:25:20 +02:00
Sebastiaan van Stijn
3eac6e7888 api/types: remove deprecated BuildResult
This alias was added in bb7dbaafcd,
which shipped in the latest v28.x releases, so we can remove this.

This removes the deprecated `api/types.BuildResult` type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:03:59 +02:00
Sebastiaan van Stijn
088cb2ffa6 api/types: remove deprecated build-related types
These aliases were added in 3d1e4d9002,
which shipped in the latest v28.x releases, so we can remove these.

This removes the deprecated `api/types`;

- `ImageBuildOptions`
- `ImageBuildOutput`
- `ImageBuildResponse`
- `BuilderVersion`
- `BuilderV1`
- `BuilderBuildKit`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 14:00:45 +02:00
Sebastiaan van Stijn
7b9bd987bf api: deprecate NoBaseImageSpecifier
This const is no longer used and will be removed in the next release.

Also fixed a var that shadowed a type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-17 15:43:08 +02:00
Sebastiaan van Stijn
4c6f586740 Merge pull request #50426 from thaJeztah/no_empty_auth
api/types/registry: EncodeAuthConfig: use empty string for zero value
2025-07-17 08:33:54 +02:00
Sebastiaan van Stijn
3a447bc079 api/types/registry: EncodeAuthConfig: use empty string for zero value
Currently, EncodeAuthConfig always returns a base64url-encoded JSON
doc, even if an empty auth-config passed. As a result, it's more
complicated to detect if authentication was present.

This patch changes the behavior to return an empty string for these
cases so that teh client can skip setting the `X-Registry-Auth` header,
and the daemon can detect whether authentication is sent or not.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-16 22:26:10 +02:00
Sebastiaan van Stijn
472e09ac47 api/types/registry: DecodeAuthConfig: add early returns and improve errors
Add an early return for empty JSON or malformed base64url values.

Before:

    go test -bench=DecodeAuthConfig -benchmem ./api/types/registry/
    goos: darwin
    goarch: arm64
    pkg: github.com/docker/docker/api/types/registry
    cpu: Apple M1 Pro
    BenchmarkDecodeAuthConfig/empty-10           47380755        25.44 ns/op      112 B/op          1 allocs/op
    BenchmarkDecodeAuthConfig/empty_JSON-10       2426870       491.70 ns/op     3056 B/op          8 allocs/op
    BenchmarkDecodeAuthConfig/valid-10             909601      1255.00 ns/op     3160 B/op         13 allocs/op
    BenchmarkDecodeAuthConfig/invalid_base64-10   1679551       703.40 ns/op     3410 B/op         15 allocs/op
    BenchmarkDecodeAuthConfig/malformed_JSON-10   1387849       817.10 ns/op     4795 B/op         12 allocs/op
    PASS

After:

    go test -bench=DecodeAuthConfig -benchmem ./api/types/registry/
    goos: darwin
    goarch: arm64
    pkg: github.com/docker/docker/api/types/registry
    cpu: Apple M1 Pro
    BenchmarkDecodeAuthConfig/empty-10           45892863        25.11 ns/op      112 B/op          1 allocs/op
    BenchmarkDecodeAuthConfig/empty_JSON-10      25347739        46.50 ns/op      115 B/op          2 allocs/op
    BenchmarkDecodeAuthConfig/valid-10            1292016       928.10 ns/op     1208 B/op         12 allocs/op
    BenchmarkDecodeAuthConfig/invalid_base64-10   5728990       208.50 ns/op      160 B/op          6 allocs/op
    BenchmarkDecodeAuthConfig/malformed_JSON-10   1821925       646.80 ns/op     2833 B/op         13 allocs/op
    PASS

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-16 22:25:43 +02:00
Sebastiaan van Stijn
6865032baa api/types/registry: add BenchmarkDecodeAuthConfig
Basic benchmark;

    go test -bench=DecodeAuthConfig -benchmem ./api/types/registry/
    goos: darwin
    goarch: arm64
    pkg: github.com/docker/docker/api/types/registry
    cpu: Apple M1 Pro
    BenchmarkDecodeAuthConfig/empty-10           47380755        25.44 ns/op      112 B/op          1 allocs/op
    BenchmarkDecodeAuthConfig/empty_JSON-10       2426870       491.70 ns/op     3056 B/op          8 allocs/op
    BenchmarkDecodeAuthConfig/valid-10             909601      1255.00 ns/op     3160 B/op         13 allocs/op
    BenchmarkDecodeAuthConfig/invalid_base64-10   1679551       703.40 ns/op     3410 B/op         15 allocs/op
    BenchmarkDecodeAuthConfig/malformed_JSON-10   1387849       817.10 ns/op     4795 B/op         12 allocs/op
    PASS

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-16 22:25:42 +02:00
Paweł Gronowski
6a8654a808 api: bump to 1.52
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-07-16 11:10:32 +02:00
Akihiro Suda
407881d45a Merge pull request #50392 from thaJeztah/authcfg_coverage
api/types/registry: add some tests for encoding/decoding authconfig
2025-07-14 19:40:52 +09:00
Sebastiaan van Stijn
4a8d77c958 api/types/container: remove deprecated ContainerTopOKBody alias
This was deprecated in be1ac5d8e5, which
was part of v28, so we can remove it for v29

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-12 20:40:03 +02:00
Sebastiaan van Stijn
3d8d9c2bb3 api/types/container: remove deprecated ContainerUpdateOKBody alias
This was deprecated in f4dc38cd36, which
was part of v28, so we can remove it for v29

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-12 20:38:50 +02:00
Sebastiaan van Stijn
d30e61bff4 api/types/registry: add some tests for encoding/decoding authconfig
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-12 15:52:50 +02:00
Rob Murray
b74c1dcca0 Merge pull request #50375 from thaJeztah/api_registry_remove_nondistributable
api/types/registry: remove deprecated fields for non-distributable artifacts
2025-07-11 15:52:10 +01:00
Sebastiaan van Stijn
11a18d3b00 api/types/registry: remove deprecated fields for non-distributable artifacts
These fields were deprecated in 1932091e21,
which is part of v28. They were kept in place for responses in older API
versions, but no longer used since 7d9c50db2b,
which implemented a fallback without requiring the fields to be present.

This patch:

- removes `ServiceConfig.AllowNondistributableArtifactsCIDRs`
- removes `ServiceConfig.AllowNondistributableArtifactsHostnames`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-10 23:47:43 +02:00
Sebastiaan van Stijn
ea29dffaa5 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>
2025-07-10 18:35:11 +02:00
Niel Drummond
51d6687754 api: swagger: Tweak type of GwPriority to integer
Signed-off-by: Niel Drummond <niel@drummond.lu>
2025-07-05 14:47:50 +01:00
Sebastiaan van Stijn
f4ddb1fd2f Merge pull request #50278 from dmcgowan/api-build-aux
Add progress aux emitter to build backend
2025-07-01 18:03:53 +02:00
Derek McGowan
87238882e0 Move api/server to daemon/server
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:18:20 -07:00
Derek McGowan
3a6e3f85c6 Move api/server/backend/build to daemon/build
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:18:05 -07:00
Derek McGowan
79f802d46a Move api/server/httputils to daemon/server/httputils
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:17:49 -07:00
Derek McGowan
c7a87f0dee Move api/server/httpstatus to daemon/server/httpstatus
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:17:33 -07:00
Derek McGowan
d64bd2cceb Move api/server/middleware to daemon/server/middleware
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:17:18 -07:00
Derek McGowan
72a020fcd8 Move api/server/router to daemon/server/router
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:17:02 -07:00
Derek McGowan
f293628f55 Move api/server/router/volume to daemon/server/router/volume
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:16:46 -07:00
Derek McGowan
15c8007064 Move api/server/router/system to daemon/server/router/system
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:16:31 -07:00
Derek McGowan
45172bbf23 Move api/server/router/swarm to daemon/server/router/swarm
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:16:15 -07:00