Open remingtonc opened 6 years ago
I believe stack rm
will remove the services/tasks before returning, but that doesn't guarantee the containers associated with those tasks have finished their shutdown. The container shutdown will be async.
@dnephin In this case I need to wait for certain containers in the stack to finish executing before proceeding with other operations. I can accomplish this through workarounds, but it feels hacky and it makes more sense for there to be some level of operational consistency when trying to work against certain containers in stacks - especially if what needs to be accomplished is only possible through base level docker
commands and doesn’t have equivalent docker stack
functionality. Current behavior is divergent and somewhat incompatible.
Description
docker stack ps <stackname>
immediately loses the name references after issuingdocker stack rm <stackname>
.docker ps
output still has the names. This inconsistency breaksdocker wait $(docker stack ps --no-trunc --format "{{.Name}}.{{.ID}}" <stackname>)
functionality.Migrating issue from https://github.com/docker/for-mac/issues/2672
Steps to reproduce the issue:
docker stack rm <stackname> && docker ps && docker stack ps <stackname>
and inspect output.Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally): Haven't completely validated the docker wait methodology exposed above - looks like sometimes
docker stack ps
outputs the full name sometimes and a truncated name other times.Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.): Physical, Docker for Mac.