Compare commits

...

7 Commits

Author SHA1 Message Date
Sebastiaan van Stijn 13053ef538
Merge 38b3e792fd into d5b327258f 2024-11-14 10:42:29 +01:00
Sebastiaan van Stijn d5b327258f
Merge pull request #5612 from thaJeztah/27.x_backport_docs
[27.x backport] assorted docs updates
2024-11-14 10:42:14 +01:00
Sebastiaan van Stijn 38b3e792fd
[27.x] vendor: github.com/docker/docker b2c682be5f56 (v27.4-dev)
full diff: https://github.com/docker/docker/compare/v27.3.1...b2c682be5f564919135e063e28a57c7a2011e555

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-11-14 10:28:21 +01:00
Sebastiaan van Stijn 2958a27e0f
Merge pull request #5610 from thaJeztah/27.x_backport_moby_deps
[27.x backport] dependency updates for moby/moby
2024-11-14 10:27:53 +01:00
David Karlsson 2734299993
docs: update example redis tags from 3.0.x to 7.4.x
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
(cherry picked from commit 172f340112)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-11-13 23:37:40 +01:00
Noah Silas 9d5a2a6b66
docs: Correct `run` exit code 126 description
The command to run inside the container is `/etc`. The semicolon is a
statement terminator, which ends the command `docker run busybox /etc`,
while `echo $?` prints the exit code of that full docker command.

Having this mistake could confuse someone who thinks that `/etc; echo
$?` is all run inside the container, which wouldn't help the reader
understand the exit code of the `docker run` command itself.

Signed-off-by: Noah Silas <noah@hustle.com>
(cherry picked from commit 0c999fe95b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-11-13 23:37:10 +01:00
Paul Rogalski 0dd07f0bfd
docs: Link supported Go duration strings
Signed-off-by: Paul Rogalski <mail@paul-rogalski.de>
(cherry picked from commit c70b2165a9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-11-13 23:36:58 +01:00
23 changed files with 116 additions and 94 deletions

View File

@ -3,7 +3,7 @@ module github.com/docker/cli/docs/generate
// dummy go.mod to avoid dealing with dependencies specific // dummy go.mod to avoid dealing with dependencies specific
// to docs generation and not really part of the project. // to docs generation and not really part of the project.
go 1.16 go 1.22.0
//require ( //require (
// github.com/docker/cli v0.0.0+incompatible // github.com/docker/cli v0.0.0+incompatible

View File

@ -43,7 +43,7 @@ The currently supported filters are:
* label (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) - only remove containers with (or without, in case `label!=...` is used) the specified labels. * label (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) - only remove containers with (or without, in case `label!=...` is used) the specified labels.
The `until` filter can be Unix timestamps, date formatted The `until` filter can be Unix timestamps, date formatted
timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed timestamps, or Go duration strings supported by [ParseDuration](https://pkg.go.dev/time#ParseDuration) (e.g. `10m`, `1h30m`) computed
relative to the daemon machines time. Supported formats for date relative to the daemon machines time. Supported formats for date
formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,
`2006-01-02T15:04:05.999999999`, `2006-01-02T07:00`, and `2006-01-02`. The local `2006-01-02T15:04:05.999999999`, `2006-01-02T07:00`, and `2006-01-02`. The local

View File

@ -66,7 +66,7 @@ The currently supported filters are:
* label (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) - only remove images with (or without, in case `label!=...` is used) the specified labels. * label (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) - only remove images with (or without, in case `label!=...` is used) the specified labels.
The `until` filter can be Unix timestamps, date formatted The `until` filter can be Unix timestamps, date formatted
timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed timestamps, or Go duration strings supported by [ParseDuration](https://pkg.go.dev/time#ParseDuration) (e.g. `10m`, `1h30m`) computed
relative to the daemon machines time. Supported formats for date relative to the daemon machines time. Supported formats for date
formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,
`2006-01-02T15:04:05.999999999`, `2006-01-02T07:00`, and `2006-01-02`. The local `2006-01-02T15:04:05.999999999`, `2006-01-02T07:00`, and `2006-01-02`. The local

View File

@ -41,7 +41,7 @@ The currently supported filters are:
* label (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) - only remove networks with (or without, in case `label!=...` is used) the specified labels. * label (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) - only remove networks with (or without, in case `label!=...` is used) the specified labels.
The `until` filter can be Unix timestamps, date formatted The `until` filter can be Unix timestamps, date formatted
timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed timestamps, or Go duration strings supported by [ParseDuration](https://pkg.go.dev/time#ParseDuration) (e.g. `10m`, `1h30m`) computed
relative to the daemon machines time. Supported formats for date relative to the daemon machines time. Supported formats for date
formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,
`2006-01-02T15:04:05.999999999`, `2006-01-02T07:00`, and `2006-01-02`. The local `2006-01-02T15:04:05.999999999`, `2006-01-02T07:00`, and `2006-01-02`. The local

View File

@ -34,11 +34,11 @@ information about available filter options.
$ docker node ps swarm-manager1 $ docker node ps swarm-manager1
NAME IMAGE NODE DESIRED STATE CURRENT STATE NAME IMAGE NODE DESIRED STATE CURRENT STATE
redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 swarm-manager1 Running Running 5 hours redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:7.4.1 swarm-manager1 Running Running 5 hours
redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 29 seconds redis.6.b465edgho06e318egmgjbqo4o redis:7.4.1 swarm-manager1 Running Running 29 seconds
redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds redis.7.bg8c07zzg87di2mufeq51a2qp redis:7.4.1 swarm-manager1 Running Running 5 seconds
redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running Running 5 seconds redis.9.dkkual96p4bb3s6b10r7coxxt redis:7.4.1 swarm-manager1 Running Running 5 seconds
redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:7.4.1 swarm-manager1 Running Running 5 seconds
``` ```
### <a name="filter"></a> Filtering (--filter) ### <a name="filter"></a> Filtering (--filter)
@ -64,11 +64,11 @@ The following filter matches all tasks with a name containing the `redis` string
$ docker node ps -f name=redis swarm-manager1 $ docker node ps -f name=redis swarm-manager1
NAME IMAGE NODE DESIRED STATE CURRENT STATE NAME IMAGE NODE DESIRED STATE CURRENT STATE
redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 swarm-manager1 Running Running 5 hours redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:7.4.1 swarm-manager1 Running Running 5 hours
redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 29 seconds redis.6.b465edgho06e318egmgjbqo4o redis:7.4.1 swarm-manager1 Running Running 29 seconds
redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds redis.7.bg8c07zzg87di2mufeq51a2qp redis:7.4.1 swarm-manager1 Running Running 5 seconds
redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running Running 5 seconds redis.9.dkkual96p4bb3s6b10r7coxxt redis:7.4.1 swarm-manager1 Running Running 5 seconds
redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:7.4.1 swarm-manager1 Running Running 5 seconds
``` ```
#### id #### id
@ -79,7 +79,7 @@ The `id` filter matches a task's id.
$ docker node ps -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1 $ docker node ps -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1
NAME IMAGE NODE DESIRED STATE CURRENT STATE NAME IMAGE NODE DESIRED STATE CURRENT STATE
redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds redis.7.bg8c07zzg87di2mufeq51a2qp redis:7.4.1 swarm-manager1 Running Running 5 seconds
``` ```
#### label #### label
@ -93,8 +93,8 @@ The following filter matches tasks with the `usage` label regardless of its valu
$ docker node ps -f "label=usage" $ docker node ps -f "label=usage"
NAME IMAGE NODE DESIRED STATE CURRENT STATE NAME IMAGE NODE DESIRED STATE CURRENT STATE
redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 10 minutes redis.6.b465edgho06e318egmgjbqo4o redis:7.4.1 swarm-manager1 Running Running 10 minutes
redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 9 minutes redis.7.bg8c07zzg87di2mufeq51a2qp redis:7.4.1 swarm-manager1 Running Running 9 minutes
``` ```

View File

@ -99,19 +99,19 @@ Creates a service as described by the specified parameters.
### Create a service ### Create a service
```console ```console
$ docker service create --name redis redis:3.0.6 $ docker service create --name redis redis:7.4.1
dmu1ept4cxcfe8k8lhtux3ro3 dmu1ept4cxcfe8k8lhtux3ro3
$ docker service create --mode global --name redis2 redis:3.0.6 $ docker service create --mode global --name redis2 redis:7.4.1
a8q9dasaafudfs8q8w32udass a8q9dasaafudfs8q8w32udass
$ docker service ls $ docker service ls
ID NAME MODE REPLICAS IMAGE ID NAME MODE REPLICAS IMAGE
dmu1ept4cxcf redis replicated 1/1 redis:3.0.6 dmu1ept4cxcf redis replicated 1/1 redis:7.4.1
a8q9dasaafud redis2 global 1/1 redis:3.0.6 a8q9dasaafud redis2 global 1/1 redis:7.4.1
``` ```
#### <a name="with-registry-auth"></a> Create a service using an image on a private registry (--with-registry-auth) #### <a name="with-registry-auth"></a> Create a service using an image on a private registry (--with-registry-auth)
@ -140,7 +140,7 @@ Use the `--replicas` flag to set the number of replica tasks for a replicated
service. The following command creates a `redis` service with `5` replica tasks: service. The following command creates a `redis` service with `5` replica tasks:
```console ```console
$ docker service create --name redis --replicas=5 redis:3.0.6 $ docker service create --name redis --replicas=5 redis:7.4.1
4cdgfyky7ozwh3htjfw0d12qv 4cdgfyky7ozwh3htjfw0d12qv
``` ```
@ -157,7 +157,7 @@ number of `RUNNING` tasks is `3`:
$ docker service ls $ docker service ls
ID NAME MODE REPLICAS IMAGE ID NAME MODE REPLICAS IMAGE
4cdgfyky7ozw redis replicated 3/5 redis:3.0.7 4cdgfyky7ozw redis replicated 3/5 redis:7.4.1
``` ```
Once all the tasks are created and `RUNNING`, the actual number of tasks is Once all the tasks are created and `RUNNING`, the actual number of tasks is
@ -167,7 +167,7 @@ equal to the desired number:
$ docker service ls $ docker service ls
ID NAME MODE REPLICAS IMAGE ID NAME MODE REPLICAS IMAGE
4cdgfyky7ozw redis replicated 5/5 redis:3.0.7 4cdgfyky7ozw redis replicated 5/5 redis:7.4.1
``` ```
### <a name="secret"></a> Create a service with secrets (--secret) ### <a name="secret"></a> Create a service with secrets (--secret)
@ -178,7 +178,7 @@ Use the `--secret` flag to give a container access to a
Create a service specifying a secret: Create a service specifying a secret:
```console ```console
$ docker service create --name redis --secret secret.json redis:3.0.6 $ docker service create --name redis --secret secret.json redis:7.4.1
4cdgfyky7ozwh3htjfw0d12qv 4cdgfyky7ozwh3htjfw0d12qv
``` ```
@ -189,7 +189,7 @@ Create a service specifying the secret, target, user/group ID, and mode:
$ docker service create --name redis \ $ docker service create --name redis \
--secret source=ssh-key,target=ssh \ --secret source=ssh-key,target=ssh \
--secret source=app-key,target=app,uid=1000,gid=1001,mode=0400 \ --secret source=app-key,target=app,uid=1000,gid=1001,mode=0400 \
redis:3.0.6 redis:7.4.1
4cdgfyky7ozwh3htjfw0d12qv 4cdgfyky7ozwh3htjfw0d12qv
``` ```
@ -215,14 +215,14 @@ pre-exist in the container. The `mode` is specified as a 4-number sequence such
as `0755`. as `0755`.
```console ```console
$ docker service create --name=redis --config redis-conf redis:3.0.6 $ docker service create --name=redis --config redis-conf redis:7.4.1
``` ```
Create a service with a config and specify the target location and file mode: Create a service with a config and specify the target location and file mode:
```console ```console
$ docker service create --name redis \ $ docker service create --name redis \
--config source=redis-conf,target=/etc/redis/redis.conf,mode=0400 redis:3.0.6 --config source=redis-conf,target=/etc/redis/redis.conf,mode=0400 redis:7.4.1
``` ```
To grant a service access to multiple configs, use multiple `--config` flags. To grant a service access to multiple configs, use multiple `--config` flags.
@ -239,7 +239,7 @@ $ docker service create \
--name redis \ --name redis \
--update-delay 10s \ --update-delay 10s \
--update-parallelism 2 \ --update-parallelism 2 \
redis:3.0.6 redis:7.4.1
``` ```
When you run a [service update](service_update.md), the scheduler updates a When you run a [service update](service_update.md), the scheduler updates a
@ -256,7 +256,7 @@ $ docker service create \
--name redis_2 \ --name redis_2 \
--replicas 5 \ --replicas 5 \
--env MYVAR=foo \ --env MYVAR=foo \
redis:3.0.6 redis:7.4.1
``` ```
To specify multiple environment variables, specify multiple `--env` flags, each To specify multiple environment variables, specify multiple `--env` flags, each
@ -268,7 +268,7 @@ $ docker service create \
--replicas 5 \ --replicas 5 \
--env MYVAR=foo \ --env MYVAR=foo \
--env MYVAR2=bar \ --env MYVAR2=bar \
redis:3.0.6 redis:7.4.1
``` ```
### <a name="hostname"></a> Create a service with specific hostname (--hostname) ### <a name="hostname"></a> Create a service with specific hostname (--hostname)
@ -277,7 +277,7 @@ This option sets the docker service containers hostname to a specific string.
For example: For example:
```console ```console
$ docker service create --name redis --hostname myredis redis:3.0.6 $ docker service create --name redis --hostname myredis redis:7.4.1
``` ```
### <a name="label"></a> Set metadata on a service (-l, --label) ### <a name="label"></a> Set metadata on a service (-l, --label)
@ -290,7 +290,7 @@ $ docker service create \
--name redis_2 \ --name redis_2 \
--label com.example.foo="bar" \ --label com.example.foo="bar" \
--label bar=baz \ --label bar=baz \
redis:3.0.6 redis:7.4.1
``` ```
For more information about labels, refer to [apply custom For more information about labels, refer to [apply custom
@ -679,7 +679,7 @@ The following command creates a global service:
$ docker service create \ $ docker service create \
--name redis_2 \ --name redis_2 \
--mode global \ --mode global \
redis:3.0.6 redis:7.4.1
``` ```
### <a name="constraint"></a> Specify service constraints (--constraint) ### <a name="constraint"></a> Specify service constraints (--constraint)
@ -712,7 +712,7 @@ $ docker service create \
--name redis_2 \ --name redis_2 \
--constraint node.platform.os==linux \ --constraint node.platform.os==linux \
--constraint node.labels.type==queue \ --constraint node.labels.type==queue \
redis:3.0.6 redis:7.4.1
``` ```
If the service constraints exclude all nodes in the cluster, a message is printed If the service constraints exclude all nodes in the cluster, a message is printed
@ -760,7 +760,7 @@ $ docker service create \
--replicas 9 \ --replicas 9 \
--name redis_2 \ --name redis_2 \
--placement-pref spread=node.labels.datacenter \ --placement-pref spread=node.labels.datacenter \
redis:3.0.6 redis:7.4.1
``` ```
This uses `--placement-pref` with a `spread` strategy (currently the only This uses `--placement-pref` with a `spread` strategy (currently the only
@ -812,7 +812,7 @@ $ docker service create \
--name redis_2 \ --name redis_2 \
--placement-pref 'spread=node.labels.datacenter' \ --placement-pref 'spread=node.labels.datacenter' \
--placement-pref 'spread=node.labels.rack' \ --placement-pref 'spread=node.labels.rack' \
redis:3.0.6 redis:7.4.1
``` ```
When updating a service with `docker service update`, `--placement-pref-add` When updating a service with `docker service update`, `--placement-pref-add`

View File

@ -40,7 +40,7 @@ For example, given the following service;
```console ```console
$ docker service ls $ docker service ls
ID NAME MODE REPLICAS IMAGE ID NAME MODE REPLICAS IMAGE
dmu1ept4cxcf redis replicated 3/3 redis:3.0.6 dmu1ept4cxcf redis replicated 3/3 redis:7.4.1
``` ```
Both `docker service inspect redis`, and `docker service inspect dmu1ept4cxcf` Both `docker service inspect redis`, and `docker service inspect dmu1ept4cxcf`
@ -65,7 +65,7 @@ The output is in JSON format, for example:
"Name": "redis", "Name": "redis",
"TaskTemplate": { "TaskTemplate": {
"ContainerSpec": { "ContainerSpec": {
"Image": "redis:3.0.6" "Image": "redis:7.4.1"
}, },
"Resources": { "Resources": {
"Limits": {}, "Limits": {},

View File

@ -37,7 +37,7 @@ $ docker service ls
ID NAME MODE REPLICAS IMAGE ID NAME MODE REPLICAS IMAGE
c8wgl7q4ndfd frontend replicated 5/5 nginx:alpine c8wgl7q4ndfd frontend replicated 5/5 nginx:alpine
dmu1ept4cxcf redis replicated 3/3 redis:3.0.6 dmu1ept4cxcf redis replicated 3/3 redis:7.4.1
iwe3278osahj mongo global 7/7 mongo:3.3 iwe3278osahj mongo global 7/7 mongo:3.3
hh08h9uu8uwr job replicated-job 1/1 (3/5 completed) nginx:latest hh08h9uu8uwr job replicated-job 1/1 (3/5 completed) nginx:latest
``` ```
@ -68,7 +68,7 @@ The following filter matches services with an ID starting with `0bcjw`:
```console ```console
$ docker service ls -f "id=0bcjw" $ docker service ls -f "id=0bcjw"
ID NAME MODE REPLICAS IMAGE ID NAME MODE REPLICAS IMAGE
0bcjwfh8ychr redis replicated 1/1 redis:3.0.6 0bcjwfh8ychr redis replicated 1/1 redis:7.4.1
``` ```
#### label #### label
@ -84,7 +84,7 @@ $ docker service ls --filter label=project
ID NAME MODE REPLICAS IMAGE ID NAME MODE REPLICAS IMAGE
01sl1rp6nj5u frontend2 replicated 1/1 nginx:alpine 01sl1rp6nj5u frontend2 replicated 1/1 nginx:alpine
36xvvwwauej0 frontend replicated 5/5 nginx:alpine 36xvvwwauej0 frontend replicated 5/5 nginx:alpine
74nzcxxjv6fq backend replicated 3/3 redis:3.0.6 74nzcxxjv6fq backend replicated 3/3 redis:7.4.1
``` ```
The following filter matches only services with the `project` label with the The following filter matches only services with the `project` label with the
@ -94,7 +94,7 @@ The following filter matches only services with the `project` label with the
$ docker service ls --filter label=project=project-a $ docker service ls --filter label=project=project-a
ID NAME MODE REPLICAS IMAGE ID NAME MODE REPLICAS IMAGE
36xvvwwauej0 frontend replicated 5/5 nginx:alpine 36xvvwwauej0 frontend replicated 5/5 nginx:alpine
74nzcxxjv6fq backend replicated 3/3 redis:3.0.6 74nzcxxjv6fq backend replicated 3/3 redis:7.4.1
``` ```
#### mode #### mode
@ -118,7 +118,7 @@ The following filter matches services with a name starting with `redis`.
```console ```console
$ docker service ls --filter name=redis $ docker service ls --filter name=redis
ID NAME MODE REPLICAS IMAGE ID NAME MODE REPLICAS IMAGE
0bcjwfh8ychr redis replicated 1/1 redis:3.0.6 0bcjwfh8ychr redis replicated 1/1 redis:7.4.1
``` ```
### <a name="format"></a> Format the output (--format) ### <a name="format"></a> Format the output (--format)

View File

@ -36,35 +36,35 @@ The following command shows all the tasks that are part of the `redis` service:
$ docker service ps redis $ docker service ps redis
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
0qihejybwf1x redis.1 redis:3.0.5 manager1 Running Running 8 seconds 0qihejybwf1x redis.1 redis:7.4.0 manager1 Running Running 8 seconds
bk658fpbex0d redis.2 redis:3.0.5 worker2 Running Running 9 seconds bk658fpbex0d redis.2 redis:7.4.0 worker2 Running Running 9 seconds
5ls5s5fldaqg redis.3 redis:3.0.5 worker1 Running Running 9 seconds 5ls5s5fldaqg redis.3 redis:7.4.0 worker1 Running Running 9 seconds
8ryt076polmc redis.4 redis:3.0.5 worker1 Running Running 9 seconds 8ryt076polmc redis.4 redis:7.4.0 worker1 Running Running 9 seconds
1x0v8yomsncd redis.5 redis:3.0.5 manager1 Running Running 8 seconds 1x0v8yomsncd redis.5 redis:7.4.0 manager1 Running Running 8 seconds
71v7je3el7rr redis.6 redis:3.0.5 worker2 Running Running 9 seconds 71v7je3el7rr redis.6 redis:7.4.0 worker2 Running Running 9 seconds
4l3zm9b7tfr7 redis.7 redis:3.0.5 worker2 Running Running 9 seconds 4l3zm9b7tfr7 redis.7 redis:7.4.0 worker2 Running Running 9 seconds
9tfpyixiy2i7 redis.8 redis:3.0.5 worker1 Running Running 9 seconds 9tfpyixiy2i7 redis.8 redis:7.4.0 worker1 Running Running 9 seconds
3w1wu13yupln redis.9 redis:3.0.5 manager1 Running Running 8 seconds 3w1wu13yupln redis.9 redis:7.4.0 manager1 Running Running 8 seconds
8eaxrb2fqpbn redis.10 redis:3.0.5 manager1 Running Running 8 seconds 8eaxrb2fqpbn redis.10 redis:7.4.0 manager1 Running Running 8 seconds
``` ```
In addition to running tasks, the output also shows the task history. For In addition to running tasks, the output also shows the task history. For
example, after updating the service to use the `redis:3.0.6` image, the output example, after updating the service to use the `redis:7.4.1` image, the output
may look like this: may look like this:
```console ```console
$ docker service ps redis $ docker service ps redis
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
50qe8lfnxaxk redis.1 redis:3.0.6 manager1 Running Running 6 seconds ago 50qe8lfnxaxk redis.1 redis:7.4.1 manager1 Running Running 6 seconds ago
ky2re9oz86r9 \_ redis.1 redis:3.0.5 manager1 Shutdown Shutdown 8 seconds ago ky2re9oz86r9 \_ redis.1 redis:7.4.0 manager1 Shutdown Shutdown 8 seconds ago
3s46te2nzl4i redis.2 redis:3.0.6 worker2 Running Running less than a second ago 3s46te2nzl4i redis.2 redis:7.4.1 worker2 Running Running less than a second ago
nvjljf7rmor4 \_ redis.2 redis:3.0.6 worker2 Shutdown Rejected 23 seconds ago "No such image: redis@sha256:6…" nvjljf7rmor4 \_ redis.2 redis:7.4.1 worker2 Shutdown Rejected 23 seconds ago "No such image: redis@sha256:6…"
vtiuz2fpc0yb \_ redis.2 redis:3.0.5 worker2 Shutdown Shutdown 1 second ago vtiuz2fpc0yb \_ redis.2 redis:7.4.0 worker2 Shutdown Shutdown 1 second ago
jnarweeha8x4 redis.3 redis:3.0.6 worker1 Running Running 3 seconds ago jnarweeha8x4 redis.3 redis:7.4.1 worker1 Running Running 3 seconds ago
vs448yca2nz4 \_ redis.3 redis:3.0.5 worker1 Shutdown Shutdown 4 seconds ago vs448yca2nz4 \_ redis.3 redis:7.4.0 worker1 Shutdown Shutdown 4 seconds ago
jf1i992619ir redis.4 redis:3.0.6 worker1 Running Running 10 seconds ago jf1i992619ir redis.4 redis:7.4.1 worker1 Running Running 10 seconds ago
blkttv7zs8ee \_ redis.4 redis:3.0.5 worker1 Shutdown Shutdown 11 seconds ago blkttv7zs8ee \_ redis.4 redis:7.4.0 worker1 Shutdown Shutdown 11 seconds ago
``` ```
The number of items in the task history is determined by the The number of items in the task history is determined by the
@ -82,10 +82,10 @@ example:
$ docker service ps --no-trunc redis $ docker service ps --no-trunc redis
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
50qe8lfnxaxksi9w2a704wkp7 redis.1 redis:3.0.6@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842 manager1 Running Running 5 minutes ago 50qe8lfnxaxksi9w2a704wkp7 redis.1 redis:7.4.1@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842 manager1 Running Running 5 minutes ago
ky2re9oz86r9556i2szb8a8af \_ redis.1 redis:3.0.5@sha256:f8829e00d95672c48c60f468329d6693c4bdd28d1f057e755f8ba8b40008682e worker2 Shutdown Shutdown 5 minutes ago ky2re9oz86r9556i2szb8a8af \_ redis.1 redis:7.4.0@sha256:f8829e00d95672c48c60f468329d6693c4bdd28d1f057e755f8ba8b40008682e worker2 Shutdown Shutdown 5 minutes ago
bk658fpbex0d57cqcwoe3jthu redis.2 redis:3.0.6@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842 worker2 Running Running 5 seconds bk658fpbex0d57cqcwoe3jthu redis.2 redis:7.4.1@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842 worker2 Running Running 5 seconds
nvjljf7rmor4htv7l8rwcx7i7 \_ redis.2 redis:3.0.6@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842 worker2 Shutdown Rejected 5 minutes ago "No such image: redis@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842" nvjljf7rmor4htv7l8rwcx7i7 \_ redis.2 redis:7.4.1@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842 worker2 Shutdown Rejected 5 minutes ago "No such image: redis@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842"
``` ```
### <a name="filter"></a> Filtering (--filter) ### <a name="filter"></a> Filtering (--filter)
@ -111,8 +111,8 @@ The `id` filter matches on all or a prefix of a task's ID.
$ docker service ps -f "id=8" redis $ docker service ps -f "id=8" redis
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
8ryt076polmc redis.4 redis:3.0.6 worker1 Running Running 9 seconds 8ryt076polmc redis.4 redis:7.4.1 worker1 Running Running 9 seconds
8eaxrb2fqpbn redis.10 redis:3.0.6 manager1 Running Running 8 seconds 8eaxrb2fqpbn redis.10 redis:7.4.1 manager1 Running Running 8 seconds
``` ```
#### name #### name
@ -123,7 +123,7 @@ The `name` filter matches on task names.
$ docker service ps -f "name=redis.1" redis $ docker service ps -f "name=redis.1" redis
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
qihejybwf1x5 redis.1 redis:3.0.6 manager1 Running Running 8 seconds qihejybwf1x5 redis.1 redis:7.4.1 manager1 Running Running 8 seconds
``` ```
@ -135,10 +135,10 @@ The `node` filter matches on a node name or a node ID.
$ docker service ps -f "node=manager1" redis $ docker service ps -f "node=manager1" redis
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
0qihejybwf1x redis.1 redis:3.0.6 manager1 Running Running 8 seconds 0qihejybwf1x redis.1 redis:7.4.1 manager1 Running Running 8 seconds
1x0v8yomsncd redis.5 redis:3.0.6 manager1 Running Running 8 seconds 1x0v8yomsncd redis.5 redis:7.4.1 manager1 Running Running 8 seconds
3w1wu13yupln redis.9 redis:3.0.6 manager1 Running Running 8 seconds 3w1wu13yupln redis.9 redis:7.4.1 manager1 Running Running 8 seconds
8eaxrb2fqpbn redis.10 redis:3.0.6 manager1 Running Running 8 seconds 8eaxrb2fqpbn redis.10 redis:7.4.1 manager1 Running Running 8 seconds
``` ```
#### desired-state #### desired-state

View File

@ -84,7 +84,7 @@ $ docker service ls
ID NAME MODE REPLICAS IMAGE ID NAME MODE REPLICAS IMAGE
3pr5mlvu3fh9 frontend replicated 5/5 nginx:alpine 3pr5mlvu3fh9 frontend replicated 5/5 nginx:alpine
74nzcxxjv6fq backend replicated 3/3 redis:3.0.6 74nzcxxjv6fq backend replicated 3/3 redis:7.4.1
``` ```
## Related commands ## Related commands

View File

@ -144,7 +144,7 @@ Docker configs report the following events:
#### <a name="since"></a> Limit events by time (--since, --until) #### <a name="since"></a> Limit events by time (--since, --until)
The `--since` and `--until` parameters can be Unix timestamps, date formatted The `--since` and `--until` parameters can be Unix timestamps, date formatted
timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed timestamps, or Go duration strings supported by [ParseDuration](https://pkg.go.dev/time#ParseDuration) (e.g. `10m`, `1h30m`) computed
relative to the client machines time. If you do not provide the `--since` option, relative to the client machines time. If you do not provide the `--since` option,
the command returns only new and/or live events. Supported formats for date the command returns only new and/or live events. Supported formats for date
formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,

View File

@ -104,7 +104,7 @@ The currently supported filters are:
* label (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) - only remove containers, images, networks, and volumes with (or without, in case `label!=...` is used) the specified labels. * label (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) - only remove containers, images, networks, and volumes with (or without, in case `label!=...` is used) the specified labels.
The `until` filter can be Unix timestamps, date formatted The `until` filter can be Unix timestamps, date formatted
timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed timestamps, or Go duration strings supported by [ParseDuration](https://pkg.go.dev/time#ParseDuration) (e.g. `10m`, `1h30m`) computed
relative to the daemon machines time. Supported formats for date relative to the daemon machines time. Supported formats for date
formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,
`2006-01-02T15:04:05.999999999`, `2006-01-02T07:00`, and `2006-01-02`. The local `2006-01-02T15:04:05.999999999`, `2006-01-02T07:00`, and `2006-01-02`. The local

View File

@ -285,7 +285,7 @@ See 'docker run --help'.
### 126 ### 126
Exit code `126` indicates that the specified contained command can't be invoked. Exit code `126` indicates that the specified contained command can't be invoked.
The container command in the following example is: `/etc; echo $?`. The container command in the following example is: `/etc`.
```console ```console
$ docker run busybox /etc; echo $? $ docker run busybox /etc; echo $?

View File

@ -3,7 +3,7 @@ module github.com/docker/cli/man
// dummy go.mod to avoid dealing with dependencies specific // dummy go.mod to avoid dealing with dependencies specific
// to manpages generation and not really part of the project. // to manpages generation and not really part of the project.
go 1.16 go 1.22.0
//require ( //require (
// github.com/docker/cli v0.0.0+incompatible // github.com/docker/cli v0.0.0+incompatible

View File

@ -11,7 +11,7 @@ then continue streaming new output from the container's stdout and stderr.
logging drivers. logging drivers.
The `--since` and `--until` options can be Unix timestamps, date formatted timestamps, The `--since` and `--until` options can be Unix timestamps, date formatted timestamps,
or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the client machine's or Go duration strings supported by [ParseDuration](https://pkg.go.dev/time#ParseDuration) (e.g. `10m`, `1h30m`) computed relative to the client machine's
time. Supported formats for date formatted time stamps include RFC3339Nano, time. Supported formats for date formatted time stamps include RFC3339Nano,
RFC3339, `2006-01-02T15:04:05`, `2006-01-02T15:04:05.999999999`, RFC3339, `2006-01-02T15:04:05`, `2006-01-02T15:04:05.999999999`,
`2006-01-02T07:00`, and `2006-01-02`. The local timezone on the client will be `2006-01-02T07:00`, and `2006-01-02`. The local timezone on the client will be

View File

@ -20,7 +20,7 @@ Docker networks report the following events:
# OPTIONS # OPTIONS
The `--since` and `--until` parameters can be Unix timestamps, date formatted The `--since` and `--until` parameters can be Unix timestamps, date formatted
timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed timestamps, or Go duration strings supported by [ParseDuration](https://pkg.go.dev/time#ParseDuration) (e.g. `10m`, `1h30m`) computed
relative to the client machine's time. If you do not provide the `--since` option, relative to the client machine's time. If you do not provide the `--since` option,
the command returns only new and/or live events. Supported formats for date the command returns only new and/or live events. Supported formats for date
formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,

View File

@ -18,7 +18,7 @@ init() {
cat > go.mod <<EOL cat > go.mod <<EOL
module github.com/docker/cli module github.com/docker/cli
go 1.19 go 1.22.0
EOL EOL
} }

View File

@ -4,7 +4,7 @@ module github.com/docker/cli
// There is no 'go.mod' file, as that would imply opting in for all the rules // There is no 'go.mod' file, as that would imply opting in for all the rules
// around SemVer, which this repo cannot abide by as it uses CalVer. // around SemVer, which this repo cannot abide by as it uses CalVer.
go 1.21.0 go 1.22.0
require ( require (
dario.cat/mergo v1.0.1 dario.cat/mergo v1.0.1
@ -13,7 +13,7 @@ require (
github.com/distribution/reference v0.6.0 github.com/distribution/reference v0.6.0
github.com/docker/cli-docs-tool v0.8.0 github.com/docker/cli-docs-tool v0.8.0
github.com/docker/distribution v2.8.3+incompatible github.com/docker/distribution v2.8.3+incompatible
github.com/docker/docker v27.3.1+incompatible github.com/docker/docker v27.3.2-0.20241108182542-b2c682be5f56+incompatible // v27.x branch (v27.4.0-dev)
github.com/docker/docker-credential-helpers v0.8.2 github.com/docker/docker-credential-helpers v0.8.2
github.com/docker/go-connections v0.5.0 github.com/docker/go-connections v0.5.0
github.com/docker/go-units v0.5.0 github.com/docker/go-units v0.5.0

View File

@ -57,8 +57,8 @@ github.com/docker/cli-docs-tool v0.8.0/go.mod h1:8TQQ3E7mOXoYUs811LiPdUnAhXrcVsB
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v27.3.1+incompatible h1:KttF0XoteNTicmUtBO0L2tP+J7FGRFTjaEF4k6WdhfI= github.com/docker/docker v27.3.2-0.20241108182542-b2c682be5f56+incompatible h1:eU/L2wtkE3wWBiqCk4QK4R8971eHeo3aI0caBNSfrmA=
github.com/docker/docker v27.3.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v27.3.2-0.20241108182542-b2c682be5f56+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo= github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=

View File

@ -7876,10 +7876,12 @@ paths:
type: "string" type: "string"
- name: "h" - name: "h"
in: "query" in: "query"
required: true
description: "Height of the TTY session in characters" description: "Height of the TTY session in characters"
type: "integer" type: "integer"
- name: "w" - name: "w"
in: "query" in: "query"
required: true
description: "Width of the TTY session in characters" description: "Width of the TTY session in characters"
type: "integer" type: "integer"
tags: ["Container"] tags: ["Container"]
@ -9244,6 +9246,19 @@ paths:
all tags of the given image that are present in the local image store all tags of the given image that are present in the local image store
are pushed. are pushed.
type: "string" type: "string"
- name: "platform"
type: "string"
in: "query"
description: |
JSON-encoded OCI platform to select the platform-variant to push.
If not provided, all available variants will attempt to be pushed.
If the daemon provides a multi-platform image store, this selects
the platform-variant to push to the registry. If the image is
a single-platform image, or if the multi-platform image does not
provide a variant matching the given platform, an error is returned.
Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}`
- name: "X-Registry-Auth" - name: "X-Registry-Auth"
in: "header" in: "header"
description: | description: |
@ -9253,11 +9268,6 @@ paths:
details. details.
type: "string" type: "string"
required: true required: true
- name: "platform"
in: "query"
description: "Select a platform-specific manifest to be pushed. OCI platform (JSON encoded)"
type: "string"
x-nullable: true
tags: ["Image"] tags: ["Image"]
/images/{name}/tag: /images/{name}/tag:
post: post:
@ -10203,10 +10213,12 @@ paths:
type: "string" type: "string"
- name: "h" - name: "h"
in: "query" in: "query"
required: true
description: "Height of the TTY session in characters" description: "Height of the TTY session in characters"
type: "integer" type: "integer"
- name: "w" - name: "w"
in: "query" in: "query"
required: true
description: "Width of the TTY session in characters" description: "Width of the TTY session in characters"
type: "integer" type: "integer"
tags: ["Exec"] tags: ["Exec"]

View File

@ -484,4 +484,6 @@ type BuildCachePruneOptions struct {
All bool All bool
KeepStorage int64 KeepStorage int64
Filters filters.Args Filters filters.Args
// FIXME(thaJeztah): add new options; see https://github.com/moby/moby/issues/48639
} }

View File

@ -2,7 +2,7 @@
Package client is a Go client for the Docker Engine API. Package client is a Go client for the Docker Engine API.
For more information about the Engine API, see the documentation: For more information about the Engine API, see the documentation:
https://docs.docker.com/engine/api/ https://docs.docker.com/reference/api/engine/
# Usage # Usage
@ -247,6 +247,14 @@ func (cli *Client) tlsConfig() *tls.Config {
func defaultHTTPClient(hostURL *url.URL) (*http.Client, error) { func defaultHTTPClient(hostURL *url.URL) (*http.Client, error) {
transport := &http.Transport{} transport := &http.Transport{}
// Necessary to prevent long-lived processes using the
// client from leaking connections due to idle connections
// not being released.
// TODO: see if we can also address this from the server side,
// or in go-connections.
// see: https://github.com/moby/moby/issues/45539
transport.MaxIdleConns = 6
transport.IdleConnTimeout = 30 * time.Second
err := sockets.ConfigureTransport(transport, hostURL.Scheme, hostURL.Host) err := sockets.ConfigureTransport(transport, hostURL.Scheme, hostURL.Host)
if err != nil { if err != nil {
return nil, err return nil, err

2
vendor/modules.txt vendored
View File

@ -55,7 +55,7 @@ github.com/docker/distribution/registry/client/transport
github.com/docker/distribution/registry/storage/cache github.com/docker/distribution/registry/storage/cache
github.com/docker/distribution/registry/storage/cache/memory github.com/docker/distribution/registry/storage/cache/memory
github.com/docker/distribution/uuid github.com/docker/distribution/uuid
# github.com/docker/docker v27.3.1+incompatible # github.com/docker/docker v27.3.2-0.20241108182542-b2c682be5f56+incompatible
## explicit ## explicit
github.com/docker/docker/api github.com/docker/docker/api
github.com/docker/docker/api/types github.com/docker/docker/api/types