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

11140 Commits

Author SHA1 Message Date
Paweł Gronowski
be03dc9ce7 vendor: github.com/docker/docker v28.2.0-dev (b45aa469cac7)
full diff: c04dec1143...b45aa469ca

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-05-16 19:35:27 +02:00
Sebastiaan van Stijn
628b2f1a81 Merge pull request #6074 from thaJeztah/c8d_errdefs_is
switch to github.com/containerd/errdefs for error-matching
2025-05-16 18:11:26 +02:00
Sebastiaan van Stijn
d43b7daeb7 Merge pull request #6075 from thaJeztah/bump_engine
vendor: github.com/docker/docker c04dec11437f (master, v28.x dev)
2025-05-16 17:27:37 +02:00
Sebastiaan van Stijn
7e609d491b vendor: github.com/docker/docker c04dec11437f (master, v28.x dev)
full diff: fd1a78e0a3...c04dec1143

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 17:01:28 +02:00
Sebastiaan van Stijn
d956110288 Merge pull request #1581 from thaJeztah/dont_use_tls_for_sockets
Don't use TLS for socket connections
2025-05-16 15:45:13 +02:00
Sebastiaan van Stijn
557cabb71e switch to github.com/containerd/errdefs for error-matching
replace uses of docker/errdefs.IsXXX utilities with their containerd/errdefs
equivalent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 15:27:43 +02:00
Sebastiaan van Stijn
c108da5d19 Merge pull request #6070 from thaJeztah/enable_importas_linter
golangci-lint: enable importas linter
2025-05-16 15:07:31 +02:00
Sebastiaan van Stijn
12992f76e0 Merge pull request #6073 from thaJeztah/format_cleanups_and_fixes
cli/command/formatter: fix .Labels format being randomized
2025-05-16 15:01:38 +02:00
Sebastiaan van Stijn
5ee17eefe6 cli/command/formatter: fix .Labels format being randomized
The labels are stored as a map, causing the output to be randomized.
This patch sorts the result to get a consistent output.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 14:11:56 +02:00
Sebastiaan van Stijn
e6bf6dcd90 cli/command/formatter: minor cleanups
no need to initialize with an empty string

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 14:10:34 +02:00
Sebastiaan van Stijn
43e496b396 cli/command/inspect: minor cleanup and improvements
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 14:10:31 +02:00
Paweł Gronowski
cacd86c3f3 Merge pull request #6072 from thaJeztah/bump_version
bump version to v28.2.0-dev
2025-05-16 11:44:29 +00:00
Paweł Gronowski
8752709427 Merge pull request #6071 from thaJeztah/update_authors2
update authors and mailmap
2025-05-16 11:44:12 +00:00
Sebastiaan van Stijn
f03aeddfcc bump version to v28.2.0-dev
This file is only used as default if no version is specified. We
should probably get rid of this, but let's update it to better
reflect the version that developer builds are building.

d48fb9f9f7/docker.Makefile (L22)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 13:00:20 +02:00
Sebastiaan van Stijn
49f2dd0761 update .mailmap and authors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 12:58:03 +02:00
Sebastiaan van Stijn
9f68bc0a2b golangci-lint: enable importas linter
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 12:36:30 +02:00
Sebastiaan van Stijn
378e754c88 use consistent alias for gotest.tools/v3/assert/cmp
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 12:36:14 +02:00
Sebastiaan van Stijn
7eaae97e37 cli/command/container: use consistent alias for oci-spec
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 12:34:28 +02:00
Sebastiaan van Stijn
67f029ec02 Don't use TLS for socket connections
Before this patch:

    mkdir -p ./tempconfig && touch ./tempconfig/ca.pem ./tempconfig/cert.pem ./tempconfig/key.pem

    DOCKER_TLS_VERIFY=1 DOCKER_CONFIG=./tempconfig DOCKER_HOST=unix:///var/run/docker.sock docker info
    Failed to initialize: failed to retrieve context tls info: ca.pem seems invalid

With this patch:

    DOCKER_TLS_VERIFY=1 DOCKER_CONFIG=./tempconfig DOCKER_HOST=unix:///var/run/docker.sock docker info
    Client:
      Version:    28.1.1-25-g2dfe7b558.m
      Context:    default
    ...

Note that the above is just to illustrate; there's still parts in context-
related code that will check for, and load TLS-related files ahead of time.
We should make some of that code lazy-loading (i.e., don't load these until
we're actually gonna make an API connection). For example, if the TLS files
are missing;

    rm ./tempconfig/*.pem
    DOCKER_TLS_VERIFY=1 DOCKER_CONFIG=./tempconfig DOCKER_HOST=unix:///var/run/docker.sock docker info
    Failed to initialize: unable to resolve docker endpoint: open tempconfig/ca.pem: no such file or directory

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 12:10:50 +02:00
Sebastiaan van Stijn
77fbbc38de Merge pull request #6063 from giautm/patch-1
cli/cli: use `len()` to check frontend ports in the `port` command
2025-05-16 12:03:15 +02:00
Sebastiaan van Stijn
bca09c7ac4 Merge pull request #6019 from thaJeztah/docker_auth_config_socket
cli/command/container: --use-api-socket: support DOCKER_AUTH_CONFIG
2025-05-16 11:57:49 +02:00
Sebastiaan van Stijn
267b5e7982 Merge pull request #6069 from thaJeztah/fluentd_completion
completion: add completion for "fluentd-write-timeout"
2025-05-16 11:46:34 +02:00
Paweł Gronowski
fe6241a5f7 Merge pull request #6066 from thaJeztah/bump_engine
vendor: github.com/docker/docker fd1a78e0a388 (master, v28.x dev)
2025-05-16 08:37:11 +00:00
Sebastiaan van Stijn
535ac074d0 completion: add completion for "fluentd-write-timeout"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 01:27:49 +02:00
Sebastiaan van Stijn
678f7182e2 Merge pull request #6045 from robmry/allow_direct_routing
Docs: Add Linux daemon option --allow-direct-routing
2025-05-16 01:24:16 +02:00
Sebastiaan van Stijn
218c7ad958 cli/command/formatter: use ContainerState consts
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 01:13:14 +02:00
Sebastiaan van Stijn
6fd9c57744 cli/command/container: use ContainerState consts
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 01:13:14 +02:00
Sebastiaan van Stijn
21e96eaaa7 cli/command/completion: use ContainerState consts in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 01:13:14 +02:00
Sebastiaan van Stijn
c9d04c770a cli/command/formatter: touch-up godoc for ContainerContext.State()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 01:13:14 +02:00
Sebastiaan van Stijn
d1c76198ba cli/command/formatter: TestContainerPsContext add test for State()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 01:13:13 +02:00
Sebastiaan van Stijn
54bf220a16 vendor: github.com/docker/docker fd1a78e0a388 (master, v28.x dev)
full diff: cb38cc0fdd...fd1a78e0a3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 01:12:36 +02:00
Paweł Gronowski
518ba2b4d8 Merge pull request #6061 from thaJeztah/bump_engine
vendor: github.com/docker/docker cb38cc0fdd55 (master, v28.x dev)
2025-05-13 07:51:58 +00:00
Giau. Tran Minh
c409383dbc cli/cli/port: use len() to check frontends ports
This ensure the command won't print an empty output if the `frontends` port is nil

Signed-off-by: Giau. Tran Minh <hello@giautm.dev>
2025-05-13 03:48:15 +07:00
Sebastiaan van Stijn
e07abcf433 vendor: github.com/docker/docker cb38cc0fdd55 (master, v28.x dev)
full diff: https://github.com/docker/docker/compare/v28.1.1...cb38cc0fdd555eae6c53be1c427c0a28d52965f6

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-12 17:28:34 +02:00
Sebastiaan van Stijn
75a57131a8 Merge pull request #6060 from vvoland/update-go
update to go1.24.3
2025-05-12 17:15:18 +02:00
Paweł Gronowski
b0da72a318 update to go1.24.3
- https://go.dev/doc/go1.24
- https://go.dev/doc/devel/release#go1.24.3

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-05-12 13:25:14 +02:00
Sebastiaan van Stijn
dd4536e4d0 Merge pull request #6058 from thaJeztah/restore_terminal
restore terminal when terminating after 3 signals
2025-05-12 10:35:20 +02:00
Sebastiaan van Stijn
a09028c837 Merge pull request #6054 from thaJeztah/unify_internal
move cli/internal/ packages to top-level internal/
2025-05-12 10:32:41 +02:00
Sebastiaan van Stijn
a17b9c542b restore terminal when terminating after 3 signals
When attaching to a container, hijack puts the terminal in raw mode,
and local echo is disabled. In normal cases, the terminal is restored
once the container detaches;
6f856263c2/cli/command/container/hijack.go (L40-L44)

However, when the CLI is forced to exit (after 3 signals), we `os.Exit(1)`,
which causes defers to not be executed, and because of this, the terminal
not being restored.

For example; start a container that's attached;

    docker run -it --rm --sig-proxy=false alpine sleep 20

In another terminal send a SIGINT 3 times to force terminate;

    kill -sINT $(pgrep -af docker\ run)
    kill -sINT $(pgrep -af docker\ run)
    kill -sINT $(pgrep -af docker\ run)

The first terminal shows that the docker cli was terminated;

    got 3 SIGTERM/SIGINTs, forcefully exiting

However, the terminal was not restored, so local echo is disabled, and
typing any command in the terminal does not show output (a manual `stty echo`
is needed to restore).

With this patch, the terminal is restored before we forcefully exit the
docker CLI. Restoring is a no-op if there's no previous state, so we
can unconditionally execute this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-09 15:26:57 +02:00
Sebastiaan van Stijn
6f856263c2 Merge pull request #6053 from thaJeztah/import_docs
docs: import: assorted fixes and touch-ups
2025-05-08 12:53:29 +02:00
Sebastiaan van Stijn
a2a13765f7 Merge pull request #6052 from thaJeztah/inspect_completion
inspect: add shell completion, improve flag-description for `--type` and improve validation
2025-05-06 20:29:54 +02:00
Sebastiaan van Stijn
12c0c13c3b Merge pull request #6051 from thaJeztah/inspect_fix_flags
docs: move flag examples to right section
2025-05-06 20:29:27 +02:00
Sebastiaan van Stijn
479c7add4d cli/internal/oauth: move to top-level "internal"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-06 20:09:28 +02:00
Sebastiaan van Stijn
b6059af164 cli/internal/logdetails: move to top-level "internal"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-06 20:04:25 +02:00
Sebastiaan van Stijn
d0d8d1dc72 cli/internal/jsonstream: move to top-level "internal"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-06 20:04:21 +02:00
Sebastiaan van Stijn
4520a390d2 docs: import: add example for multiple --change flags
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-06 19:40:53 +02:00
Sebastiaan van Stijn
763ae3e0fb docs: import: update documentation for --platform
The `--platform` flag originally was added for the experimental LCOW
feature and only accepted the target operating system. Current versions
of Docker allow passing both OS and Architecture, so updating the
documentation to reflect this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-06 19:40:53 +02:00
Sebastiaan van Stijn
2a67d601ad docs: import: update list of supported options for --change
Update the list of accepted "change" commands to match what's accepted
by the daemon. This list is the same for "docker commit" and "docker import",
which is defined by the [`validCommitCommands`] variable.

[`validCommitCommands`]: https://github.com/moby/moby/blob/v28.1.1/builder/dockerfile/builder.go#L30-L42

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-06 19:40:52 +02:00
Sebastiaan van Stijn
79207281fb docs: import: fix anchor-links and minor touch-up
- Put the content related to `--changes` under a heading with the correct
  anchor, so that it will be linked from the "options" table.
- Move note about `sudo` to be under the right example.
- Update  some examples to directly read from a file instead of piping.
- Add heading for the `--message` flag.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-06 19:40:47 +02:00
Sebastiaan van Stijn
52752f3aa2 inspect: improve (flag) validation
Produce an error if the `--type` flag was set, but an empty value
was passed.

Before this patch:

    docker inspect --type "" foo
    # json output

    docker inspect --type unknown foo
    "unknown" is not a valid value for --type

With this patch:

    docker inspect --type "" foo
    type is empty: must be one of "config", "container", "image", "network", "node", "plugin", "secret", "service", "task", "volume"

    docker inspect --type unknown foo
    unknown type: "unknown": must be one of "config", "container", "image", "network", "node", "plugin", "secret", "service", "task", "volume"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-06 15:54:29 +02:00