1
0
mirror of https://github.com/docker/cli.git synced 2026-01-13 18:22:35 +03:00
Commit Graph

10746 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
eae4c38023 internal/test/notary: add testPassRetriever helper
Add a basic helper to provide the equivalent of passphrase.ConstantRetriever
with a fixed passphrase for testing.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-02 14:15:57 +01:00
Sebastiaan van Stijn
eb82fe87a5 cli/trust: make NotaryServer a const
This var used to be vendored from github.com/docker/docker/registry, but was
removed there, and made a local var in a1cbaa827b.

It is (and should never be) modified, so let's change it into a const.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-02 12:42:13 +01:00
Sebastiaan van Stijn
fe0a8d2791 Merge pull request #5842 from jsternberg/otel-resource-attributes-merge
cli-plugins: merge OTEL_RESOURCE_ATTRIBUTES environment variable
2025-02-28 10:45:17 +01:00
Sebastiaan van Stijn
b414752ef8 Merge pull request #5851 from thaJeztah/err_handle_explicit
explicitly handle errors when wrapping them
2025-02-26 16:23:35 +01:00
Sebastiaan van Stijn
7b78eabcab Merge pull request #5872 from vvoland/vendor-docker
vendor: github.com/docker/docker v28.0.1
2025-02-26 15:40:13 +01:00
Paweł Gronowski
9e997a57fa vendor: github.com/docker/docker v28.0.1
full diff: https://github.com/docker/docker/compare/af898abe4466...v28.0.1

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-02-26 15:32:31 +01:00
Sebastiaan van Stijn
068a01ea94 Merge pull request #5870 from thaJeztah/carry_5855
Add detailed descriptions for --ulimit options in docker run documentation
v28.0.1
2025-02-25 18:52:55 +01:00
MHM0098
d75f8d83d3 Add detailed descriptions for --ulimit options in docker run documentation
Signed-off-by: MHM0098 <mhm98035@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-25 16:15:21 +01:00
Sebastiaan van Stijn
ffdfc5f94d Merge pull request #5742 from mertssmnoglu/fix-dockerfile-exec-form
fix/dockerfiles: Update CMD instruction in 'Dockerfile.dev' to use exec form
2025-02-25 15:59:09 +01:00
Paweł Gronowski
6bd9908388 Merge pull request #5867 from thaJeztah/bump_go_jose
vendor: github.com/go-jose/go-jose/v4 v4.0.5
2025-02-25 13:03:21 +00:00
Sebastiaan van Stijn
75595836f2 vendor: github.com/go-jose/go-jose/v4 v4.0.5
- Don't allow unbounded amounts of splits.
  Fixes GHSA-c6gw-w398-hv78 / CVE-2025-27144
- Various other dependency updates, small fixes, and documentation
  updates in the full changelog

full diff: https://github.com/go-jose/go-jose/compare/v4.0.4...v4.0.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-25 11:55:06 +01:00
Rob Murray
41277f53d5 Merge pull request #5865 from robmry/doc_default_bridge
Update dockerd command line ref
2025-02-24 18:14:39 +00:00
Rob Murray
4e7497e9cf Update dockerd command line ref, default bridge opts
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-02-24 18:07:06 +00:00
Rob Murray
be669099cb Update dockerd command line ref, changes in 28.0
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-02-24 18:07:06 +00:00
Paweł Gronowski
111468ccd6 Merge pull request #5864 from thaJeztah/gha_bump_docker
gha: add docker 28 to test matrix
2025-02-24 16:39:27 +00:00
Sebastiaan van Stijn
427c1361c5 gha: add docker 28 to test matrix
- set default to 28
- remove minor version from matrix; docker:dind images also provide a
  "docker:28-dind" which point to the latest minor version.
- remove TODO for 19.03, which is really out of scope now.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-24 15:14:53 +01:00
Sebastiaan van Stijn
656523e20d Merge pull request #5859 from thaJeztah/fix_docs
docs: minor fixes and touch-ups for anchor links
2025-02-24 12:05:34 +01:00
Sebastiaan van Stijn
aad2ae50e8 docs: network ls add heading and anchor for "--no-trunc"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-21 23:51:04 +01:00
Sebastiaan van Stijn
8a1b096e76 docs: fix missing anchors in swarm reference pages
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-21 23:46:07 +01:00
Sebastiaan van Stijn
c99d3312eb docs: fix broken anchor-link in "container restart" reference
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-21 23:45:32 +01:00
Paweł Gronowski
77a8a8c6ca Merge pull request #5854 from Benehiko/fix-exec-msg
cmd/docker: do not print error status on exec/run
2025-02-21 12:20:31 +00:00
Alano Terblanche
0cff340983 cmd/docker: do not print error status on exec/run
Co-authored-by: Fabio Pugliese Ornellas <fabio.ornellas@gmail.com>
Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
2025-02-21 12:55:57 +01:00
Bjorn Neergaard
eb48cad302 Merge pull request #5848 from thaJeztah/improve_swarm_completion
completion: fix / add completion for service names and node-names
2025-02-20 12:24:31 -07:00
Sebastiaan van Stijn
2493a96027 Merge pull request #5850 from thaJeztah/fix_context_err
cli/command/context: fix error-handling of skip-tls-verify
2025-02-20 18:37:04 +01:00
Sebastiaan van Stijn
8f55738579 completion: add completion for docker service flags
Not all flags have completions yet, and for those that don't have completion,
we disable completion to prevent it completing with filenames.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-20 18:33:17 +01:00
Sebastiaan van Stijn
768d10767f completion: add completion for docker node flags
With this patch:

    docker node update --role
    manager  worker

    docker node update --availability
    active  drain   pause

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-20 18:33:17 +01:00
Sebastiaan van Stijn
d5e6e2ec6e completion: add completion for node names
Change completion for nodes to use names by default, and bring back
support for the `DOCKER_COMPLETION_SHOW_NODE_IDS` env-var
f9ced58158/contrib/completion/bash/docker (L38)

With this patch:

    docker node ps <tab>
    docker-desktop            self

    export DOCKER_COMPLETION_SHOW_NODE_IDS=yes
    docker node ps <TAB>
    docker-desktop             qyeriqk20al6hy4y869d08ff5  self

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-20 18:33:09 +01:00
Sebastiaan van Stijn
da4b6275ba explicitly handle errors when wrapping them
The errors.Wrap and errors.Wrapf functions gracefully handle nil-errors.
This allows them to be used unconditionally regardless if an error
was produced.

While this can be convenient, it can also be err-prone, as replacing
these with stdlib errors means they unconditionally produce an error.

This patch replaces code uses of errors.Wrap to be gated by a check
for nil-errors to future-proof our code.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-20 18:10:36 +01:00
Sebastiaan van Stijn
7e71782ba6 cli/command/context: fix error-handling of skip-tls-verify
Before 2b9a4d5f4c, this function
would use "errors.Wrap" which returns nil if the original error
was nil. fmt.Errorf does not do this, so without a nil check,
it would unconditionally return an error;

    docker context create arm64 --docker host=ssh://172.17.101.26,skip-tls-verify=False

    unable to create docker endpoint config: name: %!w(<nil>)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-20 17:49:58 +01:00
Sebastiaan van Stijn
762d59359e completion: use service names, and support DOCKER_COMPLETION_SHOW_SERVICE_IDS
Change completion for services to use names by default, and bring back
support for the `DOCKER_COMPLETION_SHOW_SERVICE_IDS` env-var
f9ced58158/contrib/completion/bash/docker (L41-L43)

Before this patch:

    docker service ps
    c9vrp2pwni9gx5ghat20rjpcy  hmthf0tqws9xpmd87ok7diqly

With this patch:

    docker service ps<TAB>
    databaseservice  webservice

    export DOCKER_COMPLETION_SHOW_SERVICE_IDS=yes
    docker service ps<TAB>
    c9vrp2pwni9gx5ghat20rjpcy  databaseservice            hmthf0tqws9xpmd87ok7diqly  webservice

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-20 13:51:38 +01:00
Paweł Gronowski
f9ced58158 Merge pull request #5845 from vvoland/vendor-docker
vendor: github.com/docker/docker v28.0.0-dev (af898abe4466)
v28.0.0
2025-02-19 22:05:47 +00:00
Paweł Gronowski
33f327a98f vendor: github.com/docker/docker v28.0.0-dev (af898abe4466)
full diff: https://github.com/docker/docker/compare/v28.0.0-rc.3...af898abe4466

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-02-19 22:55:43 +01:00
Jonathan A. Sternberg
8890a1c929 cli-plugins: remove docker.cli specific otel attributes after usage
Remove the `docker.cli` prefixed attributes from
`OTEL_RESOURCE_ATTRIBUTES` after the telemetry provider has been created
within a plugin. This prevents accidentally sending the attributes to
something downstream for the user.

This also fixes an issue with compose where the self-injected `OTEL_RESOURCE_ATTRIBUTES`
would override an existing attribute in the environment file because the
"user environment" overrode the environment file, but the "user
environment" was created by the `docker` tool rather than by the user's
environment.

When `OTEL_RESOURCE_ATTRIBUTES` is empty after pruning, the environment
variable is unset.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-02-19 10:19:00 -06:00
Sebastiaan van Stijn
9e60cfe42e Merge pull request #5843 from thaJeztah/bump_engine_28.0_rc3
vendor: github.com/docker/docker v28.0.0-rc.3
2025-02-19 17:08:38 +01:00
Sebastiaan van Stijn
96eb1e97da Merge pull request #5841 from sarahsanders-docker/reference-styling-issue
reference docs: fix missing link from heading
2025-02-19 17:08:08 +01:00
Sarah Sanders
f977b923cd Fix missing link from Configure node healthcheck heading
Update name to dispatcher-heartbeat

Signed-off-by: Sarah Sanders <sarah.sanders@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-19 16:56:28 +01:00
Sebastiaan van Stijn
f53cee5dd1 vendor: github.com/docker/docker v28.0.0-rc.3
no diff; same commit, but tagged:

https://github.com/docker/docker/compare/00ab386b5a2e...v28.0.0-rc.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-19 13:48:22 +01:00
Paweł Gronowski
1dcfd230bf Merge pull request #5840 from thaJeztah/bump_engine_28.0_rc3
vendor: github.com/docker/docker 62bc5979908f (master, v28.0.0-rc.3)
v28.0.0-rc.3
2025-02-18 22:17:28 +00:00
Sebastiaan van Stijn
fe349e6a6c vendor: github.com/docker/docker 00ab386b5a2e (master, v28.0.0-rc.3)
no code changes, only updated swagger (docs)

full diff: https://github.com/docker/docker/compare/v28.0.0-rc.2...00ab386b5a2e

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-02-18 23:04:48 +01:00
Jonathan A. Sternberg
cfe0605616 cli-plugins: merge OTEL_RESOURCE_ATTRIBUTES environment variable
Merge `OTEL_RESOURCE_ATTRIBUTES` when there is one already in the
environment. This allows user-specified resource attributes to be passed
on to CLI plugins while still allowing the extra attributes added for
telemetry information.

This was the original intended use-case but it seems to have never made
it in. The reason `OTEL_RESOURCE_ATTRIBUTES` was used is because we
could combine it with user-centric ones.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-02-18 12:06:46 -06:00
Sebastiaan van Stijn
a8f888677b Merge pull request #5838 from thaJeztah/bump_engine
vendor: github.com/docker/docker v28.0.0-rc.2
2025-02-18 13:55:15 +01:00
Sebastiaan van Stijn
136901961d vendor: github.com/docker/docker v28.0.0-rc.2
no diff; same commit, but tagged;

https://github.com/docker/docker/compare/57d4d23825f4...v28.0.0-rc.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-18 13:40:15 +01:00
Sebastiaan van Stijn
bfd49b1ec3 Merge pull request #5836 from thaJeztah/nakedret
golangci-lint: fix invalid nakedret config, disallow for any func length
2025-02-18 13:15:28 +01:00
Sebastiaan van Stijn
5e32ccefac Merge pull request #5835 from thaJeztah/bump_golangci_lint
Dockerfile: update golangci-lint to v1.64.5, replace deprecated `tenv` linter in favor of `usetesting`
2025-02-18 13:15:06 +01:00
Sebastiaan van Stijn
e3abf7f5d1 Merge pull request #5834 from thaJeztah/more_linters
golangci-lint: enable revive line-length-limit, unused-receiver linters
2025-02-18 13:14:22 +01:00
Sebastiaan van Stijn
a8affefeea golangci-lint: replace deprecated tenv linter in favor of usetesting
WARN The linter 'tenv' is deprecated (since v1.64.0) due to: Duplicate feature another linter. Replaced by usetesting.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-18 12:25:13 +01:00
Sebastiaan van Stijn
1c8243cc95 golangci-lint: fix invalid nakedret config, disallow for any func length
The regex was added before we migrateed from gometalinter in
dbd96badb6, and got migrated to golangci-lint
in b7e06f2845. The format used for the config
was invalid, and migrating it to the right format didn't make a difference,
so we can remove it.

As naked returns are generally not desirable, also setting the minimum func
length to 0 (i.e., don't allow any naked returns), instead of the default

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-18 09:36:12 +01:00
Sebastiaan van Stijn
a5020ea165 cli/command/container: don't use naked returns (nakedret)
cli/command/container/cp.go:206:3: naked return in func `resolveLocalPath` with 5 lines of code (nakedret)
            return
            ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-18 09:36:11 +01:00
Sebastiaan van Stijn
e569b9f74a cli/internal/oauth: don't use naked returns (nakedret)
cli/internal/oauth/jwt.go:62:3: naked return in func `GetClaims` with 9 lines of code (nakedret)
            return
            ^
    cli/internal/oauth/jwt.go:67:2: naked return in func `GetClaims` with 9 lines of code (nakedret)
        return
        ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-18 09:36:11 +01:00
Sebastiaan van Stijn
3e9fa43ef8 cli/command/trust: fix "usetesting" linting errors
Also fix some unhandled errors

    cli/debug/debug_test.go:12:3: os.Setenv() could be replaced by t.Setenv() in TestEnable (usetesting)
            os.Setenv("DEBUG", "")
            ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-17 23:00:13 +01:00