veggiemonk / awesome-docker

:whale: A curated list of Docker resources and projects
https://awesome-docker.netlify.app
Apache License 2.0
30.6k stars 3k forks source link

Docker Monitoring Docker #988

Closed satyabratabharati closed 2 years ago

satyabratabharati commented 2 years ago

I have developed a tool which can monitor another container and provide the memory/cpu/disk statistics of a running container.

I need to pass the dockerID of a container as input to my program. But the issue is how do I know if the container being monitor is restated. in this case the dockerID has changed.

How do I know if a container is restarted and fetch the dockerID every time the container is starts/restart.

welcome[bot] commented 2 years ago

Thanks for opening your first issue here!

mashb1t commented 2 years ago

Hey @satyabratabharati, i hope you can understand that this repository is not ment to provide support for specific implementation-problems for Docker and also should not be used for that.

Nevertheless you may use a mount to the Docker socket for adding an event listener to changes of containers you listen to (e.g. like in the nginx reverse proxy) when a container is started/stopped with a specific env var value.

All the best for the implementation!