Open kha84 opened 1 month ago
Hi @kha84, thanks for the contribution!
I definitely agree, and we've actually been discussing improvements internally to things such as the image list and other commands, particularly regarding integrations with plugins (such as your Compose suggestion) – ideally, IMO, since Compose is the plugin that know about the annotations it sets, Compose could enhance the container list output for these containers.
We have to have some discussion in terms of how to implement this, but IMO this is something we'd like to do, just need to figure out how/do it.
I'll share internally as well :).
Description
It would be incredibly helpful if
docker ps
could include a built-in indicator showing whether a container was created usingdocker-compose
ordocker run
directly, without requiring additional commands or manual inspection.Problem
Currently, there is no straightforward way to immediately tell from
docker ps
whether a container was created withdocker-compose
. Users have to:docker inspect
to check for thecom.docker.compose
labels.This extra step makes managing large sets of containers cumbersome, especially when both
docker-compose
anddocker run
are used in parallel within a project or environment.Proposed Solution
Add an indicator in the output of
docker ps
to differentiate containers based on their creation method. For example, this could include:docker-compose
,docker run
, etc.).docker-compose
, also show the Compose project name and service name as additional columns (e.g.,PROJECT/SERVICE
).Example output
Benefits
docker-compose
and which are standalone without needing to inspect each container manually.docker inspect
or setting up custom naming schemes to differentiate container origins.Considerations
docker ps --show-origin
), depending on how cluttered the output might get in different scenarios.Closing Thoughts
This feature would significantly enhance usability, especially for users who work with both
docker-compose
anddocker run
. It would improve container management and make thedocker ps
command more informative and user-friendly.