Skip to content
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

Docker warnings about orphan containers #108

Open
neezer opened this issue Aug 8, 2020 · 1 comment
Open

Docker warnings about orphan containers #108

neezer opened this issue Aug 8, 2020 · 1 comment

Comments

@neezer
Copy link

neezer commented Aug 8, 2020

Trying out cage for the first time, and I'm getting warnings similar to this every time I do cage up:

WARNING: Found orphan containers (publicsearch_redis_1, publicsearch_pg_1, publicsearch_configuration_1, publicsearch_rabbitmq_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.

I've removed all containers from my system and run docker system prune, yet the warnings persist: I get a warning about the containers for each pod that just booted. Cage still seems to work fine despite them, but they sure are annoying. Can something be done about it?

https://asciinema.org/a/3JUPMYfXQ2juMcFyLpOsN2qOq

@neezer
Copy link
Author

neezer commented Aug 10, 2020

Looking into this a little further, it seems these are being outputted because the internal docker-compose command for anything cage-related doesn't specify different project names for the pods.

If cage added a -p flag that was pod-specific, I think these would go away. Would also make it so that the automatic generated names for the containers were scoped to both the cage project folder and the pod, eg.

- publicsearch_rabbitmq_1
+ publicsearch_messaging_rabbitmq_1

... where the service rabbitmq was defined in a cage project in pods/messaging.yml.

Otherwise the project names always match, so you'll get warnings for any containers you're not currently executing commands against—at least that's been my experience so far.

See https://stackoverflow.com/questions/50947938/docker-compose-orphan-containers-warning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant