grammarly / rocker-compose

Docker composition tool with idempotency features for deploying apps composed of multiple containers.
Other
407 stars 26 forks source link

removeContainer fails to register docker event #55

Closed jaychris closed 8 years ago

jaychris commented 8 years ago

If I knew anything more than the basics of Go, I'd try to implement this myself. I still might try just for the exercise, but it won't be quick.

It appears that RemoveContainer implements the equivalent of the docker command "rm -f", instead of stop/rm. The outcome of this is that when "rocker-compose rm" is run, it fails to register a Docker event that the container has stopped. This means that service registration tools (such as gliderlabs/registrator), fail to notice and de-register the services that the container was providing.

For example: I run an infrastructure that uses Consul for dynamic service registration and gliderlabs/registrator to register container services as they are deployed. I deploy a container using rocker-compose run..., the container is deployed, and registrator registers the available services with Consul. I run rocker-compose rm ..., the container is removed, but the registered services are orphaned in Consul since no docker event is registered.

This is similar to the scenario where you run docker rm -f ... from the command line.

docker-compose has a "down" option that does a clean stop/rm procedure, which results in a Docker event that registrator fires on to de-register the container services in Consul.

It would be useful if there were another rocker-compose command that did the same thing as docker-compose down.

jaychris commented 8 years ago

user issue, sorry.