-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 3 restart policy #355
Comments
@konstruktoid The information is available, at least when the docker host is in swarm mode (I don't have a non-swarm host handy to check.)
I suspect this may even let you check all containers in the swarm - even on other hosts - but I'm not 100% sure on that. |
Long time no see @shawngmc, time for an interesting twist. docker service inspect $(docker service ls -q) --format '{{.Spec.TaskTemplate.RestartPolicy}}' will return Same thing for each container: for r in $(docker service ls -q); do docker inspect --format '{{.ID}} {{.Spec.RestartPolicy}}' $(docker service ps -q "$r"); done nr7xltm2v0orqfcewha99uqo9 {on-failure 5s 0xc0005d1380 2m0s}
ki7vm7cg1qy1y5zgw475p6y14 {on-failure 5s 0xc0003b2158 2m0s}
q9gxe7gvicz4pnef61lmdcte1 {on-failure 5s 0xc0005d1998 2m0s}
jnnjman1czt7gcq08buogijsy {on-failure 5s 0xc0005d1e48 2m0s} The issue is that the containers no longer shows up with the
They do however if you use a basic
docker-bench-security output:
|
I suspect this is a side effect of swarm orchestration and how it's deployed. Are you testing this on a single node docker swarm? On a single-node swarm, I brought up the offending file with
If I use
However, if this is not a single node docker swarm, the situation is different. If the swarm has multiple nodes, swarm will publish the service to every node, but will provide the service as the deploy key recommends. The default is one copy of the container with no node preference or replication. If the container goes down or the node hosting the container goes down, it'll start on another node if possible. |
Yeah, but another issue that arises when you have to use |
Agreed, that's a bit annoying. I think there are a couple ways to tackle this.
I personally like option 1, because a multi-node cluster owner should be running docker bench on every node anyway. |
I guess we have to check if there's a service running and then flag various test, just like we do in the |
In version 3 compose has another restart configuration
And this configuration doesn't make changes in
docker inspect
:So 5.14 test is failed =\
The text was updated successfully, but these errors were encountered: