DOCKER SERVICE INSPECT
Commande : docker service inspect
Usage: docker service inspect [OPTIONS] SERVICE [SERVICE...] Display detailed information on one or more services Options: -f, --format string Format the output using the given Go template --pretty Print the information in a human friendly format
Afficher les informations détaillés relatives à un service
docker service inspect [OPTIONS] service [service...]
ex :
$ docker service inspect redis
[
{
"ID": "yi70e6urtfnhlhpwiqhul4x23",
"Version": {
"Index": 21
},
"CreatedAt": "2018-10-22T22:15:03.411349711Z",
"UpdatedAt": "2018-10-22T22:15:03.411349711Z",
"Spec": {
"Name": "redis",
"Labels": {},
"TaskTemplate": {
"ContainerSpec": {
"Image": "redis:3.0.6@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842",
"StopGracePeriod": 10000000000,
"DNSConfig": {},
"Isolation": "default"
[...]
"RollbackConfig": {
"Parallelism": 1,
"FailureAction": "pause",
"Monitor": 5000000000,
"MaxFailureRatio": 0,
"Order": "stop-first"
},
"EndpointSpec": {
"Mode": "vip"
}
},
"Endpoint": {
"Spec": {}
}
}
]
$ docker service inspect --pretty redis
ID: yi70e6urtfnhlhpwiqhul4x23
Name: redis
Service Mode: Replicated
Replicas: 5
Placement:
UpdateConfig:
Parallelism: 1
On failure: pause
Monitoring Period: 5s
Max failure ratio: 0
Update order: stop-first
RollbackConfig:
Parallelism: 1
On failure: pause
Monitoring Period: 5s
Max failure ratio: 0
Rollback order: stop-first
ContainerSpec:
Image: redis:3.0.6@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842
Resources:
Endpoint Mode: vip
$ docker service inspect --format='{{.Spec.Mode.Replicated.Replicas}}' redis
5