Commit Graph

11959 Commits

Author SHA1 Message Date
Austin Vazquez d17643a675 Merge pull request #6537 from thaJeztah/no_nw_shadow
rename some vars to prevent shadowing imports
2025-10-07 06:31:30 -07:00
Sebastiaan van Stijn 3754fe3c8a rename some vars to prevent shadowing imports
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-06 22:49:02 +02:00
Austin Vazquez 30ec4c09b3 Merge pull request #6536 from thaJeztah/cleanups
cli/command/container: inline some variables
2025-10-06 13:21:31 -07:00
Austin Vazquez 6d351158cc Merge pull request #6535 from thaJeztah/remove_localhostDNSWarning
cli/command/container: remove localhostDNSWarning
2025-10-06 13:10:37 -07:00
Sebastiaan van Stijn 6222292566 cli/command/container: inline some variables
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-06 21:26:17 +02:00
Sebastiaan van Stijn c06c08531a cli/command/container: remove localhostDNSWarning
This warning is better handled by the daemon, where applicable, as
the client does not have all information available to determine
if using a localhost / loopback-address for the DNS is possible.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-06 21:23:50 +02:00
Paweł Gronowski 74e3520724 Merge pull request #6530 from thaJeztah/bump_macos
gha: add macOS 15, remove macOS 13 (deprecated)
2025-10-03 14:04:10 +00:00
Paweł Gronowski 886e041790 Merge pull request #6532 from thaJeztah/bump_creds_helper_0.9.4
vendor: github.com/docker/docker-credential-helpers v0.9.4
2025-10-03 14:02:59 +00:00
Paweł Gronowski 9dea52c193 Merge pull request #6527 from thaJeztah/no_WithInitializeClient
cli/command: don't use WithInitializeClient in test
2025-10-03 14:02:37 +00:00
Paweł Gronowski 780c427550 Merge pull request #6526 from thaJeztah/no_plugin_load
cmd/docker: setFlagErrorFunc: don't load plugins for invalid flags
2025-10-03 14:02:16 +00:00
Sebastiaan van Stijn ca6f899a58 Merge pull request #6525 from thaJeztah/rm_client_side_autorm
remove support for AutoRemove (`--rm`) on API < 1.30
2025-10-03 11:58:03 +02:00
Sebastiaan van Stijn 395152ce88 vendor: github.com/docker/docker-credential-helpers v0.9.4
full diff: https://github.com/docker/docker-credential-helpers/compare/v0.9.3...v0.9.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-02 22:25:45 +02:00
Paweł Gronowski f5a7a3c72e Merge pull request #6528 from thaJeztah/deprecate_ResolveDefaultContext
cli/command: deprecate ResolveDefaultContext
2025-10-01 13:25:04 +00:00
Sebastiaan van Stijn 394ab41696 Merge pull request #6524 from thaJeztah/rm_deprecated_virtualsize
remove VirtualSize formatting options and output
2025-10-01 12:09:25 +02:00
Sebastiaan van Stijn 91d8c0bf62 gha: add macOS 15, remove macOS 13 (deprecated)
The macOS 13 runners are deprecated and will be removed on December 4th,
with brownouts in November;
https://github.blog/changelog/2025-09-19-github-actions-macos-13-runner-image-is-closing-down/

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-01 11:59:56 +02:00
Sebastiaan van Stijn 311a97a210 cli/command: deprecate ResolveDefaultContext
The ResolveDefaultContext function was exported in [cli@f820766] to allow
(unit) testing, but did not document that it was only exported for this
purpose. The only external use of this function is in buildx, which uses
it in a unit test that can be implemented without this function.

This patch deprecates the function so that we can remove it.

[cli@f820766]: https://github.com/docker/cli/commit/f820766f6ac57188d96c9ca377f2b4627e90da28

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-01 11:47:24 +02:00
Sebastiaan van Stijn b375006c3e cli/command: don't use WithInitializeClient in test
It's just a wrapper around WithAPIClient, and not needed for this
test, which validates that "Initialize" properly creates the context
store, even if a client was already set;
3b26cfce8b

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-01 10:12:11 +02:00
Sebastiaan van Stijn b0201c8531 cmd/docker: hideUnsupportedFeatures: remove unused error return
```
70.72 cmd/docker/docker.go:560:74: hideUnsupportedFeatures - result 0 (error) is always nil (unparam)
70.72 func hideUnsupportedFeatures(cmd *cobra.Command, details versionDetails) error {
70.72                                                                          ^
70.72 1 issues:
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-01 01:57:59 +02:00
Sebastiaan van Stijn 2b4fd0d750 cmd/docker: setFlagErrorFunc: don't load plugins for invalid flags
On Docker CLI versions before v28.0.0, using an unknown flag would print
the usage output, showing all available top-level flags and commands;

    docker --badopt
    unknown flag: --badopt
    See 'docker --help'.

    Usage:  docker [OPTIONS] COMMAND

    A self-sufficient runtime for containers

    Options:
          --config string      Location of client config files (default "/root/.docker")
    ...

This output did not include plugin-commands, making the usage output
incomplete. That issue was fixed in [cli@40a6cf7], which loaded all
available cli-plugins, so that a stub was created for printing the
plugin commands in the usage output. Similarly, [cli@79a75da] added
code to hide experimental commands and commands not supported by the
daemon.

However, since 28.0.0 (commit [cli@f28fc7f]), the usage output was
removed for this error, so loading plugins is no longer needed;

    docker --badopt
    unknown flag: --badopt

    Usage:  docker [OPTIONS] COMMAND [ARG...]

    Run 'docker --help' for more information

This patch removes the code added in [cli@40a6cf7] and [cli@79a75da].

With this patch, the output is still the same;

    docker --unknown-flag buildx ls --no-such
    unknown flag: --unknown-flag

    Usage:  docker [OPTIONS] COMMAND [ARG...]

    Run 'docker --help' for more information

This function only handles flags defined by the CLI itself; invalid
flags for plugins are handled by the plugin itself, so are not
impacted;

    docker buildx ls --no-such
    unknown flag: --no-such

    Usage:  docker buildx ls

    Run 'docker buildx ls --help' for more information

[cli@f28fc7f]: https://github.com/docker/cli/commit/f28fc7f82fc87d0ed521de452b6227cee76fd956
[cli@40a6cf7]: https://github.com/docker/cli/commit/40a6cf7c477cf328134b0b8dcdbd9a09d02f918b
[cli@79a75da]: https://github.com/docker/cli/commit/79a75da0fd97b02311676028c3406b242c785f7c

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-01 01:15:53 +02:00
Sebastiaan van Stijn 63c5254201 remove support for AutoRemove (--rm) on API < 1.30
Support for daemon-side auto-remove was added in API v1.25; on older
versions of the daemon, the client was responsible for removing the
container after it exited (see [moby@6dd8e10])

On API versions < 1.30, it used the events API for this purpose, and
would wait for a "die", "detach" or "detroy" events to know the container
exited, and could be removed or (when attached, but without a TTY) to
get the container's exit-status. (see [cli@38591f2]).

API version 1.24 (docker 1.12) is 9 Years old (July 29, 2016), and API
1.30 (docker 17.06) is 8 Years old (Jun 20, 2017), and long EOL. While
technically, a CLI could negotiate API 1.30 or older, this would only
be in cases where either API version negotiation failed, or the version
was explicitly overridden through `DOCKER_API_VERSION` for testing.

Either of those cases would be rare, and not worth the technical complexity
to support. This patch removes support for AutoRemove on API < 1.30.

[moby@6dd8e10]: https://github.com/moby/moby/commit/6dd8e10d6ed7a7371c5c1824ad58c4403a7b3bfd
[cli@38591f2]: https://github.com/docker/cli/commit/38591f20d07795aaef45d400df89ca12f29c603b

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-30 18:16:57 +02:00
Sebastiaan van Stijn 1b90a53be2 remove deprecated VirtualSize formatting options and output
The `VirtualSize` field was deprecated in [moby@1261fe6], and omitted / removed
in API v1.44 in [moby@913b0f5], and the corresponding formatting placeholder
was deprecated in [cli@f02301a].

This patch removes the formatting function, which also removes it from the
`docker image ls --format=json` output.

[moby@1261fe6]: https://github.com/moby/moby/commit/1261fe69a3586bb102182aa885197822419c768c
[moby@913b0f5]: https://github.com/moby/moby/commit/913b0f51cab18a56247a950f5f1e75ca79b63039
[cli@f02301a]: https://github.com/docker/cli/commit/f02301ab5d38f98362d3f4c6975580c27fa750aa

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-30 16:31:57 +02:00
Sebastiaan van Stijn c361deb85d docs, man: image ls: remove VirtualSize from examples
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-30 16:26:06 +02:00
Sebastiaan van Stijn adfcb88896 man: inspect: update some inspect examples
remove various deprecated fields from the example

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-30 16:23:19 +02:00
Austin Vazquez 9c79528489 Merge pull request #6523 from thaJeztah/rm_deprecated
cli/manifest/store: remove deprecated IsNotFound
2025-09-30 05:36:34 -07:00
Austin Vazquez 9874437110 Merge pull request #6521 from thaJeztah/bump_moby
vendor: github.com/moby/moby/api, moby/client master
2025-09-30 05:35:30 -07:00
Sebastiaan van Stijn 39d9a0cd51 cli/manifest/store: remove deprecated IsNotFound
This was deprecated in f3fb7728c7, which
is part of 28.5.0, and no longer used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-30 12:59:02 +02:00
Sebastiaan van Stijn 9d97363f8f vendor: github.com/moby/moby/api, moby/client master
full diff: https://github.com/moby/moby/compare/9a97f59e6e2d51818f6b8cf8589199fd6714ebc7...4ca8aedf929f726ac68f96482e2fb704a72b1326

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-30 10:43:02 +02:00
Sebastiaan van Stijn 21e768adb7 Merge pull request #6520 from thaJeztah/bump_moby
vendor: github.com/moby/moby/api, moby/client master
2025-09-30 09:31:05 +02:00
Sebastiaan van Stijn cdcf267264 vendor: github.com/moby/moby/api, moby/client master
full diff: https://github.com/moby/moby/compare/e98849831fc4...9a97f59e6e2d51818f6b8cf8589199fd6714ebc7

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-29 18:00:59 -05:00
Austin Vazquez f8932e916b Merge pull request #6515 from thaJeztah/rm_authconfig_email
cli/config/types: remove deprecated AuthConfig.Email field
2025-09-29 16:00:21 -07:00
Sebastiaan van Stijn e9664b9f34 cli/config/types: remove deprecated AuthConfig.Email field
Relates to [cli@27b2797], which forked this type from the Moby API, and
[cli@aab947d], which fixed the deprecation comment.

This field is no longer used since Docker 1.11 (API version 1.23) through
[moby@aee260d] and [engine-api@9a9e468], and the fix of the deprecation
comment was included in the 28.4.0 release.

This patch removes the field.

[cli@27b2797]: https://github.com/docker/cli/commit/27b2797f7deb3ca5b7f80371d825113deb1faca1
[cli@aab947d]: https://github.com/docker/cli/commit/aab947de8f5cd2db3dd9d8ead0f38d3246557750
[moby@aee260d]: https://github.com/moby/moby/commit/aee260d4eb3aa0fc86ee5038010b7bbc24512ae5
[engine-api@9a9e468]: https://github.com/docker-archive-public/docker.engine-api/commit/9a9e468f503eb731d6fdc9d7f98c122e1b397c86

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-29 17:50:54 -05:00
Austin Vazquez a61ecaf3c7 Merge pull request #6516 from thaJeztah/authconfig_no_direct_cast
cli/command: explicitly map AuthConfig fields instead of a direct cast
2025-09-29 15:49:22 -07:00
Austin Vazquez 7e8b893952 Merge pull request #6517 from thaJeztah/memstore_notfounderr
cli/config/memorystore: remove unused IsErrValueNotFound
2025-09-29 15:13:24 -07:00
Austin Vazquez 5a4758f513 Merge pull request #6513 from thaJeztah/manifeststore_notfound
cli/manifest/store: deprecate IsNotFound
2025-09-29 15:11:13 -07:00
Austin Vazquez 1b467f909c Merge pull request #6512 from thaJeztah/less_trust
remove some uses of trust-specific types
2025-09-29 15:02:31 -07:00
Sebastiaan van Stijn 3c78ac2aad cli/config/memorystore: remove unused IsErrValueNotFound
This utility was added in 9b83d5bbf9, but
was never used. Remove the utility, and rewrite the error returned to
implement the errdefs.NotFound interface, so that it can be detected
using the errdefs.IsNotFound() utility if needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-29 13:05:08 +02:00
Sebastiaan van Stijn 9f02d9643d cli/command: explicitly map AuthConfig fields instead of a direct cast
Commit [cli@27b2797] forked the AuthConfig type from the API, and changed
existing code to do a direct cast / convert of the forked type to the API
type. This can cause issues if the API types diverges, such as the removal
of the Email field.

This patch explicitly maps each field to the corresponding API type, but
adds some TODOs, because various code-paths only included a subset of the
fields, which may be intentional for fields that were meant to be handled
on the daemon / registry-client only.

We should evaluate these conversions to make sure these fields should
be sent from the client or not (and possibly even removed from the API
type).

[cli@27b2797]: https://github.com/docker/cli/commit/27b2797f7deb3ca5b7f80371d825113deb1faca1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-29 12:57:52 +02:00
Sebastiaan van Stijn f3fb7728c7 cli/manifest/store: deprecate IsNotFound
Deprecate the IsNotFound utility in favor of errdefs.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-26 23:33:01 +02:00
Sebastiaan van Stijn 0dec83f572 cli/command/image: imagePullPrivileged: move to non-trust file
This function is a wrapper around apiClient.ImagePull and not directly
related to docker content trust; it just happens to also be called
when using content trust (through the trustedPull utility).

Move it together with the `runPull` function to separate it from
trust-related code.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-26 20:06:32 +02:00
Sebastiaan van Stijn e58a6ace45 cli/command/image: imagePullPrivileged: don't use ImageRefAndAuth
This function is a wrapper around apiClient.ImagePull; the use of
trust.ImageRefAndAuth was out of convenience because it's also called
when using content trust (through the trustedPull utility).

Let's pull away the layers to separate it from trust code.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-26 20:06:32 +02:00
Sebastiaan van Stijn a6946d0fbf cli/command/image: notaryClientProvider: don't require arguments
This interface is used in tests to provide a dummy notary client,
but none of the tests require any arguments, so let's remove them.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-26 20:06:26 +02:00
Sebastiaan van Stijn c3317b0a43 cli/trust: Server: accept registry hostname
The IndexInfo was only used to detect if the target was an official
image, which we can deduct from the hostname. Adding some normalizing
just in case (but we should only get "docker.io" here).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-26 18:51:32 +02:00
Sebastiaan van Stijn 75f3c08257 Merge pull request #6505 from thaJeztah/bump_runewidth
vendor: github.com/mattn/go-runewidth v0.0.17
2025-09-26 11:31:18 +02:00
Sebastiaan van Stijn aaed38f5d5 Merge pull request #6507 from thaJeztah/split_trust_auth
cli/command/image: pushTrustedReference: internalize constructing indexInfo
2025-09-26 11:24:31 +02:00
Paweł Gronowski fdf9b43ca8 Merge pull request #6506 from thaJeztah/bump_mapstructure
vendor: github.com/go-viper/mapstructure/v2 v2.4.0
2025-09-26 09:22:38 +00:00
Paweł Gronowski 95735d1631 Merge pull request #6504 from thaJeztah/bump_protobuf
vendor: google.golang.org/protobuf v1.36.9
2025-09-26 09:22:29 +00:00
Paweł Gronowski 013c41c602 Merge pull request #6508 from thaJeztah/dct_retiring
trust: print deprecation warning when using hub Notary server
2025-09-26 09:16:45 +00:00
Sebastiaan van Stijn 43b03ef2c5 trust: print deprecation warning when using hub Notary server
Docker Hub's Notary service is being retired, and now produces
failures in most cases. Add a warning when attempting to use
it, pending full removal of trust;
https://www.docker.com/blog/retiring-docker-content-trust/

With this PR:

    DOCKER_CONTENT_TRUST=1 docker pull -q hello-world
    WARNING: Docker is retiring DCT for Docker Official Images (DOI).
             For details, refer to https://docs.docker.com/go/dct-deprecation/

    could not validate the path to a trusted root: unable to retrieve valid leaf certificates

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-26 11:09:07 +02:00
Sebastiaan van Stijn 9a6313ed3b cli/command/image: pushTrustedReference: internalize constructing indexInfo
All information needed can be deducted from the image reference, which
is used to create a indexInfo, repoInfo, and to resolve auth-config.

In some situations this may result in resolving the auth-config twice
after it already was resolved to an encoded auth-config.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-26 10:09:12 +02:00
Sebastiaan van Stijn 20e5dc9469 vendor: github.com/go-viper/mapstructure/v2 v2.4.0
full diff: https://github.com/go-viper/mapstructure/compare/v2.2.1...v2.4.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-25 19:47:12 +02:00