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

10419 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
91d097e70b Merge pull request #5683 from thaJeztah/bump_xx
update xx to v1.6.1 for compatibility with alpine 3.21
2024-12-13 14:38:36 +01:00
Sebastiaan van Stijn
5b36e1b34a Merge pull request #5691 from thaJeztah/remove_netfilter_warnings
cli/command/system: remove netfilter warnings from tests
2024-12-13 13:11:14 +01:00
Sebastiaan van Stijn
55e404e7a8 cli/command/system: remove netfilter warnings from tests
These warnings will no longer be returned by the daemon, so remove
them from the tests as well to make them more representative of
reality.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-13 10:29:01 +01:00
Sebastiaan van Stijn
4c2a184aaf Merge pull request #5689 from thaJeztah/bump_gomd2man
update go-md2man to v2.0.5
2024-12-13 02:01:07 +01:00
Sebastiaan van Stijn
eaa8b5716d update go-md2man to v2.0.5
full diff: https://github.com/cpuguy83/go-md2man/compare/v2.0.4...v2.0.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-13 01:21:51 +01:00
Rob Murray
2080e09905 Merge pull request #5599 from robmry/option_ipv4
Add option --ipv4
2024-12-12 15:10:48 +00:00
Rob Murray
6a2cde6c75 Add option '--ipv4'
Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-12-10 15:51:21 +00:00
Rob Murray
5c896c95d0 Docs: emphasise that some options that are for docker0
Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-12-10 15:51:21 +00:00
Sebastiaan van Stijn
26526f9970 Merge pull request #5674 from thaJeztah/registry_trimname
registry/client: remove uses of APIEndpoint.TrimHostName
2024-12-10 12:28:12 +01:00
Rob Murray
a5353e55da Docs: include --fixed-cidr-v6 and --bip6 docker0 options
Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-12-10 09:44:59 +00:00
Sebastiaan van Stijn
1e51ae7af2 update xx to v1.6.1 for compatibility with alpine 3.21
This fixes compatibility with alpine 3.21

- Fix additional possible `xx-cc`/`xx-cargo` compatibility issue with Alpine 3.21
- Support for Alpine 3.21
- Fix `xx-verify` with `file` 5.46+
- Fix possible error taking lock in `xx-apk` in latest Alpine without `coreutils`

full diff: https://github.com/tonistiigi/xx/compare/v1.5.0...v1.6.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-10 10:12:58 +01:00
Sebastiaan van Stijn
2a5ac8f5ab vendor: github.com/docker/docker b249c5ebd214 (master, v28.0.0-dev)
full diff: 5d72419486...b249c5ebd2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-09 21:56:05 +01:00
Sebastiaan van Stijn
afab765014 registry/client: remove uses of APIEndpoint.TrimHostName
This field was added in 19515a7ad8,
but looks to be always set for endpoints used, so we can trim remote names
unconditionally.

This option was added for possible future expansion, allowing registry-
mirrors to get the full reference of the image (including domain-name),
for them to host a mirror for multiple upstreams on the same registry.

That approach will unlikely be implemented, and containerd has a different
approach for this, where the reference to the original registry is passed
through a query parameter instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-09 21:51:02 +01:00
Sebastiaan van Stijn
e554bfef6c Merge pull request #5662 from laurazard/consistent-attach-check
run: correctly handle only STDIN attached
2024-12-09 18:01:45 +01:00
Sebastiaan van Stijn
619ea8e134 Merge pull request #5673 from thaJeztah/bump_engine
vendor: github.com/docker/docker 5d72419486fe (master, v28.0.0-dev)
2024-12-09 17:43:27 +01:00
Laura Brehm
7dab597e6d tests: cleanup comment
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-12-09 15:49:21 +00:00
Laura Brehm
30c4637f03 run: don't hang if only attaching STDIN
If STDOUT or STDERR are attached and the container exits, the streams
will be closed by the daemon while the container is exiting, causing
the streamer to return an error
61b02e636d/cli/command/container/hijack.go (L53)
that gets sent
61b02e636d/cli/command/container/run.go (L278)
and received
61b02e636d/cli/command/container/run.go (L225)
on `errCh`.

However, if only STDIN is attached, it's not closed (since this is
attached to the user's TTY) when the container exits, so the streamer
doesn't exit and nothing gets sent on `errCh`, meaning the CLI execution
hangs receiving on `errCh` on L231.

Change the logic to receive on both `errCh` and `statusChan` – this way,
if the container exits, we get notified on `statusChan` (even if only
STDIN is attached), and can cancel the streamer and exit.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-12-09 15:49:20 +00:00
Sebastiaan van Stijn
2eb77f4ede vendor: github.com/docker/docker 5d72419486fe (master, v28.0.0-dev)
full diff: 87fbd9cd3b...5d72419486

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-09 12:41:45 +01:00
Sebastiaan van Stijn
9dfdffa015 Merge pull request #5672 from thaJeztah/bump_protobuf
vendor: google.golang.org/protobuf v1.35.2
2024-12-09 12:11:31 +01:00
Sebastiaan van Stijn
395716be3f Merge pull request #5679 from thaJeztah/remove_use_of_nondistributable_artifacts
cli/command/system: don't use "non-distributable-artifacts" fields in tests
2024-12-09 12:05:53 +01:00
Laura Brehm
be6ddae56d Merge pull request #5671 from thaJeztah/bump_x_deps 2024-12-09 11:49:04 +01:00
Sebastiaan van Stijn
b51a71148f cli/command/system: don't use "non-distributable-artifacts" fields in tests
Nondistributable artifacts are deprecated, and no longer used; we'll be
deprecating these fields, so let's already skip their use.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-07 12:24:59 +01:00
Sebastiaan van Stijn
f50dea6c40 vendor: google.golang.org/protobuf v1.35.2
full diff: https://github.com/protocolbuffers/protobuf-go/compare/v1.35.1...v1.35.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-06 22:45:30 +01:00
Sebastiaan van Stijn
9399483f7a vendor: golang.org/x/net v0.31.0
full diff: https://github.com/golang/net/compare/v0.30.0...v0.31.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-06 22:40:39 +01:00
Sebastiaan van Stijn
6751bcc972 vendor: golang.org/x/crypto v0.29.0
no changes in vendored code

full diff: https://github.com/golang/crypto/compare/v0.28.0...v0.29.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-06 22:39:54 +01:00
Sebastiaan van Stijn
d41ab7703a vendor: golang.org/x/term v0.26.0
full diff: https://github.com/golang/term/compare/v0.25.0...v0.26.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-06 22:38:55 +01:00
Sebastiaan van Stijn
5972025fae vendor: golang.org/x/text v0.20.0
no changes in vendored code

full diff: https://github.com/golang/text/compare/v0.19.0...v0.20.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-06 22:35:41 +01:00
Sebastiaan van Stijn
feb1e2a34c vendor: golang.org/x/sync v0.9.0
no changes in vendored code

full diff: https://github.com/golang/sync/compare/v0.8.0...v0.9.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-06 22:34:43 +01:00
Sebastiaan van Stijn
4c27c895f2 vendor: golang.org/x/sys v0.27.0
full diff: https://github.com/golang/sys/compare/v0.26.0...v0.27.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-06 22:33:47 +01:00
Sebastiaan van Stijn
66dfe6d428 Merge pull request #5664 from akerouanton/gw-priority
run, create, connect: add support for gw-priority
2024-12-06 22:20:57 +01:00
Sebastiaan van Stijn
97010d13f3 Merge pull request #5667 from thaJeztah/login_clean
cli/command/registry: assorted refactor and test changes
2024-12-06 14:42:22 +01:00
Sebastiaan van Stijn
e7078bf20c Merge pull request #5668 from thaJeztah/update_go_1.23.4
update to go1.23.4
2024-12-04 13:14:52 +01:00
Sebastiaan van Stijn
a1e57ac72d update to go1.23.4
go1.23.4 (released 2024-12-03) includes fixes to the compiler, the runtime,
the trace command, and the syscall package. See the Go 1.23.4 milestone on
our issue tracker for details:

- https://github.com/golang/go/issues?q=milestone%3AGo1.23.4+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.23.3...go1.23.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-04 10:33:14 +01:00
Sebastiaan van Stijn
e398d16c04 cli/command/registry: return status only instead of whole response
Various functions were passing through the API response as a whole, but
effectively only needed it for a status message (if any). Reduce what's
returned to only the message.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-03 19:04:24 +01:00
Sebastiaan van Stijn
297afb2a2b cli/command/registry: TestLoginWithCredStoreCreds slight refactor
- also check errors that were previously not handled
- use the fakeCLI's buffer instead of creating one manually

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-03 18:42:40 +01:00
Sebastiaan van Stijn
575e373669 cli/command/registry: rename some vars that collided with imports
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-03 18:37:35 +01:00
Albin Kerouanton
d4db289eb5 run, create, connect: add support for gw-priority
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2024-12-03 15:13:08 +01:00
Sebastiaan van Stijn
cf89afb32b cli/command/registry: storeCredentials: accept configfile as arg
This function only needs access to the configfile

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-03 13:00:59 +01:00
Sebastiaan van Stijn
b5a00d0b0f cli/command/registry: loginWithRegistry: use shallower interface
This function only needs the API client, not all of the CLI.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-03 12:50:12 +01:00
Sebastiaan van Stijn
13f0d46411 cli/command/registry: don't return creds on error
Be more explicit on not returning a response if there was an error;
change some non-exported functions to return a pointer, and return
nil instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-03 12:48:12 +01:00
Laura Brehm
a3d9fc4941 run: cleanup – remove errCh nil check
Now, if running in "detached" mode, we early exit at L222.

Similarly, if `attachContainer` errors out, it returns an error that
gets handled on L190.

As such, `errCh` can never be nil on L231. Remove the nil check.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-12-02 14:35:30 +00:00
Laura Brehm
446f36ce58 run: cleanup – move "detached" early exit earlier
Since everything else after the `apiClient.ContainerStart` block is
under an `if attach` conditional, we can move the "detached" early exit
up.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-12-02 14:35:29 +00:00
Laura Brehm
8431298824 run: cleanup – use attached where applicable
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-12-02 14:34:28 +00:00
Laura Brehm
aee9eebf34 run: return error code when only STDIN attached
During a `docker run`, the CLI has some different behavior/output
depending on whether the run is "detached" or not.

In some cases, the CLI is checking whether either `stdin`, `stdout` or
`stderr` are attached, but in other cases we're only checking `stdout`
and `stderr`, which leads to some inconsistencies:

```
$ docker run -a stdout --rm --name test alpine top
[docker kill test]
exit status 137

$ docker run -a stderr --rm --name test alpine top
[docker kill test]
exit status 137

$ docker run -a stdin --rm --name test alpine top
56820d94a89b96889478241ae68920323332c6d4cf9b51ba9340cba01e9e0565
[docker kill test]
[no exit code]
```

Since we're not checking for whether `stdin` is attached when deciding
whether to early exit without receiving on `statusChan`, the `docker run
-a stdin` is falling into the "detached mode" logic, which simply prints
the container ID and doesn't print/return the exit code.

This patch makes the "attached" checks consistent.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-12-02 14:31:26 +00:00
Laura Brehm
5afa739692 Merge pull request #5660 from thaJeztah/remove_repoinfo_class 2024-12-02 13:51:47 +01:00
Sebastiaan van Stijn
ed9fcf31e6 cli/trust: GetNotaryRepository: remove uses of RepositoryInfo.Class
The Class field was added because  Docker Hub registry required a special
scope to be set for pulling plugins;

    HTTP/1.1 401 Unauthorized
    ...
    Www-Authenticate: Bearer realm="https://auth.docker.io/token",service="registry.docker.io",scope="repository(plugin):vieux/sshfs:pull",error="insufficient_scope"

This is no longer a requirement, and the field is no longer set.

updates 0ba820ed0b

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-11-30 14:44:34 +01:00
Sebastiaan van Stijn
61b02e636d Merge pull request #5607 from robmry/v6only/host_gateway_ip
Docs: host-gateway-ip daemon option IPv4+IPv6
2024-11-29 23:03:48 +01:00
Rob Murray
c629eca890 Put --help before --host in the dockerd manpage
Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-11-29 17:10:09 +00:00
Rob Murray
ea84e8f94b Add --host-gateway to the dockerd manpage
Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-11-29 17:10:09 +00:00
Rob Murray
cf88ab074a Docs: host-gateway-ip daemon option IPv4+IPv6
The host-gateway-ip daemon option now accepts two addresses, one
IPv4 and one IPv6.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-11-29 17:10:09 +00:00