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-compose ps enhancements #2369

Closed
dnephin opened this issue Nov 11, 2015 · 7 comments
Closed

docker-compose ps enhancements #2369

dnephin opened this issue Nov 11, 2015 · 7 comments

Comments

@dnephin
Copy link

dnephin commented Nov 11, 2015

This issue is to aggregate all the requests for enhancements to ps.

We need to find a way to support all of this without making the default unnecessarily verbose. I think we should be keeping the default fairly close to what we have now.

One option is to add a bunch of flags to include new columns.

@lmesz
Copy link

lmesz commented Nov 13, 2015

Hello,

Thanks to gather the PRs and issues around PS.
I think the default should be as it is, but give an oportunity the user to customize the columns would be great. E.g.: docker ps:

Name Command State Ports

dockermaster_etcd_1 /etcd Up 0.0.0.0:2379->2379/tcp, 2380/tcp, 4001/tcp, 7001/tcp
dockermaster_etcd_2 /etcd Up 0.0.0.0:2380->2379/tcp, 2380/tcp, 4001/tcp, 7001/tcp

docker ps --columns name
dockermaster_etcd_1
dockermaster_etcd_2

And docker ps --help should show the available columns. And ps shouldn't rely on tty at all IMHO, cause for example when user process the output from script there's no such a thing like tty.
The "machine readable output, as json" would be also great. With --json should drop the ps output like a simple json array as you suggested the original PR.

@achekulaev
Copy link

I wanted to bring up another notice. Currently ps returns container name as a first column

# docker-compose ps
     Name                    Command                State     Ports 
-------------------------------------------------------------------
fusion114_cli_1   /opt/startup.sh /bin/sh -c ...   Exit 137         
fusion114_db_1    /entrypoint.sh mysqld            Exit 128         
fusion114_web_1   /opt/startup.sh apache2 -D ...   Exit 0   

However that value is useless for any other docker-compose command as docker-compose can not work with container names but only works with services.

# docker-compose ps fusion114_cli_1
No such service: fusion114_cli_1
# docker-compose ps cli
     Name                    Command                State     Ports 
-------------------------------------------------------------------
fusion114_cli_1   /opt/startup.sh /bin/sh -c ...   Exit 137   

It makes sense to drop Name column and introduce Service Name or Service column instead.

# docker-compose ps
Service                    Command                State     Ports 
-------------------------------------------------------------------
cli         /opt/startup.sh /bin/sh -c ...   Exit 137         
db          /entrypoint.sh mysqld            Exit 128         
web         /opt/startup.sh apache2 -D ...   Exit 0   

@tflori
Copy link

tflori commented Feb 28, 2017

especially a docker-compose --columns "name, state" will be very intresting for me. I'm running some containers that have a lot of ports (hardware/mailserver for example) and I just want to check if everything is up but it's hard to follow the lines when some containers have more than one line..

@znerd
Copy link

znerd commented Jun 22, 2018

Feature parity, and output format parity, across docker ps and docker-compose ps would be very nice.

E.g.:

  • docker ps supports filtering (with the -f/-filter option), while docker-compose ps does not
  • docker ps supports formatting (with the --format option), while docker-compose ps does not
  • docker-ps just returns one line with column names and then the info, while docker-compose ps includes a horizontal line in the output
  • etc.

@reitzig
Copy link

reitzig commented Sep 3, 2019

@achekulaev Only if you want to docker cp you'll need the container name.

@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 17, 2022
@stale
Copy link

stale bot commented Apr 25, 2022

This issue has been automatically closed because it had not recent activity during the stale period.

@stale stale bot closed this as completed Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants