1206 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
443b548efa client: ExecCreate: rename Tty to TTY
Align with ExecStartOptions

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-05 15:53:03 +01:00
Sebastiaan van Stijn
ebc1dfbb64 client: singularize prune methods
All methods are singular; while pruning will impact multiple items,
it's more consistent to use singular for all operations.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-05 15:48:02 +01:00
Sebastiaan van Stijn
39ccd04ca8 api/types/swarm: define type for RegistryAuthSource
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-05 13:48:38 +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
Sebastiaan van Stijn
dc22f2c8bf client: make ImageSaveResult an interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 18:39:52 +01:00
Sebastiaan van Stijn
5c8a9b7b9e client: make TaskLogsResult an interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 18:27:29 +01:00
Sebastiaan van Stijn
7dc9d39ca1 client: make ContainerLogsResult an interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 18:21:07 +01:00
Sebastiaan van Stijn
8d0b09c722 client: make ServiceLogsResult an interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 18:08:54 +01:00
Sebastiaan van Stijn
0257c642c7 client: make ContainerExportResult an interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 18:01:42 +01:00
Sebastiaan van Stijn
5bfc628e97 client: make ImageImportResult an interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 18:01:42 +01:00
Sebastiaan van Stijn
5fc866fbfd client: make ImageLoadResult an interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 16:28:35 +01:00
Sebastiaan van Stijn
1051c7f89e client: Client.ImageLoad: move description of platform parameter
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 16:28:35 +01:00
Sebastiaan van Stijn
b30eb86b31 go.mod: add back replace rules
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 16:08:47 +01:00
Sebastiaan van Stijn
31f7f62d6c client/pkg/security: simplify
This utility is used to split the SecurityOptions field from the
"/info" response into a slice of security.Option. It's effectively
only used by the CLI to present the `docker info` output, but has
a use in buildx to parse the response.

We can assume the daemon returns a valid response, remove the error-
conditions and fallback for legacy daemon versions (< 1.13), and limit
it to parsing the response only.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-03 11:36:44 +01:00
Paweł Gronowski
93c273dc11 vendor: github.com/moby/moby/api v1.52.0-beta.4
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-31 18:57:59 +01:00
Paweł Gronowski
56bd456694 Drop replace rules
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-31 18:41:46 +01:00
Paweł Gronowski
76ba3b6a4b Merge pull request #51366 from vvoland/client-removeimagecreate
client: Remove ImageCreate in favor of ImagePull/ImageImport
2025-10-31 16:36:38 +01:00
Paweł Gronowski
73455ce01a client: Remove ImageCreate in favor of ImagePull/ImageImport
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-31 14:48:54 +01:00
Austin Vazquez
a087d03e0c client: refactor create network api implementation to wrap options/results
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-30 23:45:18 -05:00
Sebastiaan van Stijn
12c9de37e9 api/types: move Version to api/types/system
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-31 02:09:38 +01:00
Sebastiaan van Stijn
3d28cb8bbd client: ServerVersionResult: add back legacy fields
Short term solution; we need to decide whether these should be kept
or removed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-31 01:21:10 +01:00
Sebastiaan van Stijn
97a1d44f05 Merge pull request #51342 from thaJeztah/client_platforms
client: prepare option-structs for multiple platforms
2025-10-30 22:18:58 +01:00
Paweł Gronowski
5a871b8299 Merge pull request #51156 from corhere/client-pkg-jsonmessage
client/pkg/jsonmessage: refactor in terms of `api/types/jsonstream`
2025-10-30 19:33:21 +01:00
Sebastiaan van Stijn
d1f70d4f54 client: deprecate NewClientWithOpts in favor of New
Use a more idiomatic name so that it can be used as `client.New()`.

We should look if we want `New()` to have different / updated defaults
i.e., enable `WithEnv` as default, and have an opt-out and have API-
version negotiation enabled by default (with an opt-out option).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-30 18:09:44 +01:00
Sebastiaan van Stijn
137adde33d client: prepare option-structs for multiple platforms
Some methods currently support a single platform only, but we may
be able to support multiple platforms.

This patch prepares the option-structs for multi-platform support,
but (for now) returning an error if multiple options are provided.

We need a similar check on the daemon-side, but still need to check
on the client, as older daemons will ignore multiple platforms, which
may be unexpected.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-30 18:04:34 +01:00
Austin Vazquez
860307c4ea client: refactor ServerVersion to return ServerVersionResult
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-30 14:22:41 +01:00
Sebastiaan van Stijn
6c042389a3 client: use sub-tests for ServiceLogs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-30 11:31:18 +01:00
Sebastiaan van Stijn
e8e7f1a500 client: use sub-tests for ContainerLogs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-30 11:27:48 +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
a5c0f152a7 daemon: improve validation for container rename
Improve validation for empty name; while the daemon already handled empty
strings, it didn't account for the "canonical" name with "/" prefix, for
which it would produce an obscure error:

    Error response from daemon: Error when allocating new name: Invalid container name (/ ), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed

Before this change:

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.51/containers/old/rename?name='
    {"message":"Neither old nor new names may be empty"}

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.51/containers/old/rename?name=/'
    {"message":"Error when allocating new name: Invalid container name (/), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed"}

    curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.51/containers/old/rename?name=/hello'
    # OK

A check was added in the client as well for situations where an older daemon
is used; the same code currently was implemented in the CLI.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 18:42:36 +01:00
Sebastiaan van Stijn
7a8d8733c0 Merge pull request #51330 from thaJeztah/fix_client_example
client: fix example, and add runnable example
2025-10-29 18:17:34 +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
Austin Vazquez
6cf02b5cba client: remove unused import
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-29 11:21:52 -05:00
Austin Vazquez
c5e318dbde Merge pull request #51328 from vvoland/client-containercopy-structs
client/container_copy: Wrap options and result struct
2025-10-29 10:44:59 -05:00
Sebastiaan van Stijn
b910408187 Merge pull request #51326 from vvoland/client-containerupdate-structs
client/container_update: Wrap options and result
2025-10-29 15:17:28 +01:00
Sebastiaan van Stijn
3c62b06de2 client: fix example, and add runnable example
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 15:16:58 +01:00
Paweł Gronowski
1cc2ab16ce client/container_copy: Wrap options and result struct
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-29 14:34:19 +01:00
Austin Vazquez
214cd508c0 Merge pull request #51327 from thaJeztah/unexport_NewVersionError
client: un-export NewVersionError, rename to requiresVersion
2025-10-29 08:08:41 -05:00
Austin Vazquez
a7a94c393d Merge pull request #51325 from thaJeztah/refactor_client_network_step1
client: refactor NetworkConnect, NetworkDisconnect, NetworkRemove
2025-10-29 08:06:32 -05:00
Sebastiaan van Stijn
e9631b507e Merge pull request #51323 from thaJeztah/container_wait_nits
client: ContainerWait: touch-up GoDoc, and remove legacy code, and use singular for channels (ContainerWaitResult)
2025-10-29 13:41:02 +01:00
Paweł Gronowski
38d703ff6f client/container_update: Wrap options and result
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-29 13:30:22 +01:00
Austin Vazquez
e9f28e2a41 client: refactor NetworkConnect, NetworkDisconnect, NetworkRemove
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 13:02:01 +01:00
Paweł Gronowski
c755b9635d Merge pull request #51322 from vvoland/client-fixup
client: Rename ContainerUnPause* to ContainerUnpause*
2025-10-29 12:56:32 +01:00
Paweł Gronowski
f708214dbf Merge pull request #51324 from thaJeztah/network_connect_disconnect
api/types/network: define `ConnectRequest` and `DisconnectRequest`
2025-10-29 12:56:15 +01:00
Sebastiaan van Stijn
2d6bf9332b client: un-export NewVersionError, rename to requiresVersion
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 12:44:41 +01:00
Sebastiaan van Stijn
29ad05b130 client: ContainerWaitResult: use singular for channels
These channels should ever only return a single result, so rename
them to match that expectation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 12:37:46 +01:00
Sebastiaan van Stijn
51a0584088 client: ContainerWait: touch-up GoDoc, remove legacy code
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 12:37:42 +01:00
Sebastiaan van Stijn
7041c02abd Merge pull request #51320 from thaJeztah/refactor_client_system_step1
client: refactor Events, Info, RegistryLogin
2025-10-29 12:25:28 +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
b5971b6ae3 Merge pull request #51315 from austinvazquez/refactor-client-container-rename
client: refactor `ContainerRename` to wrap options/result structs
2025-10-29 11:41:33 +01:00