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 ps -v for verbose info: PID and namespace #32501

Open
brendangregg opened this Issue Apr 10, 2017 · 19 comments

Comments

Projects
None yet
@brendangregg

brendangregg commented Apr 10, 2017

This is a feature request for listing init PID and namespace info easily, eg, by adding a -v (for verbose) flag to docker ps. Here's a simple prototype in bash to show what I mean:

# ./dockerpsv.sh 
CONTAINER      NAME                    PID PATH             CGROUP     IPC        MNT        NET        PID        USER       UTS       
host           bgregg-xenial-bpf-i-      1 systemd          4026531835 4026531839 4026531840 4026532197 4026531836 4026531837 4026531838
02a7cf65f82e   agitated_perlman       4560 bash             4026531835 4026532381 4026532379 4026532384 4026532382 4026531837 4026532380
3b2350c3cf2b   tender_almeida        25068 bash             4026531835 4026532442 4026532440 4026532445 4026532443 4026531837 4026532441

In my prototype (not shown above), I color namespaces red that match the host, to make it easy to see which namespaces are shared with the host.

Source: https://gist.github.com/brendangregg/1abcfeef9155ac526197f6f0abdd86bf

@borntorock

This comment has been minimized.

Show comment
Hide comment
@borntorock

borntorock commented Apr 11, 2017

+1

@brendangregg

This comment has been minimized.

Show comment
Hide comment
@brendangregg

brendangregg Apr 11, 2017

Thought about it a bit more... instead of -v, this might be better as -N|--namespaces. On non-Linux, it would report "This option only supported on Linux."

Later on, we could also add a -C|--cgroups option to print cgroup details by-container in a similar way. Although I don't have a prototype yet.

brendangregg commented Apr 11, 2017

Thought about it a bit more... instead of -v, this might be better as -N|--namespaces. On non-Linux, it would report "This option only supported on Linux."

Later on, we could also add a -C|--cgroups option to print cgroup details by-container in a similar way. Although I don't have a prototype yet.

@maksadbek

This comment has been minimized.

Show comment
Hide comment
@maksadbek

maksadbek Apr 16, 2017

I see nobody started to working on this, so I would like to pick this up

maksadbek commented Apr 16, 2017

I see nobody started to working on this, so I would like to pick this up

@brendangregg

This comment has been minimized.

Show comment
Hide comment
@brendangregg

brendangregg Apr 17, 2017

Thanks; FWIW I'm including a screenshot of this in my DockerCon talk on Wednesday, so if you have anything ready by then (prototype) I can mention it.

brendangregg commented Apr 17, 2017

Thanks; FWIW I'm including a screenshot of this in my DockerCon talk on Wednesday, so if you have anything ready by then (prototype) I can mention it.

@maksadbek

This comment has been minimized.

Show comment
Hide comment
@maksadbek

maksadbek Apr 18, 2017

@brendangregg I have just looked up codebase(cli part) and figured out where to add this feature.
I am not sure that I can finish the prototype till Wednesday(tomorrow).

maksadbek commented Apr 18, 2017

@brendangregg I have just looked up codebase(cli part) and figured out where to add this feature.
I am not sure that I can finish the prototype till Wednesday(tomorrow).

@cpuguy83

This comment has been minimized.

Show comment
Hide comment
@cpuguy83

cpuguy83 Apr 19, 2017

Contributor

Would rather not add a -v flag.
We support a --format flag for CLI formating, however this would require some extra work to be performed by the daemon.

This information would be fairly expensive to get for a list of containers... unless we cache it on container start.

Contributor

cpuguy83 commented Apr 19, 2017

Would rather not add a -v flag.
We support a --format flag for CLI formating, however this would require some extra work to be performed by the daemon.

This information would be fairly expensive to get for a list of containers... unless we cache it on container start.

@maksadbek

This comment has been minimized.

Show comment
Hide comment
@maksadbek

maksadbek Apr 19, 2017

@cpuguy83
What do you recommend to implement this with caching on the start?

For the prototype, I was intended to make a template for the "namespaces" flag, and run stat util on each ps command to gather info(this is what the bash script does)

Earlier @brendangregg suggested using -N|--namespaces instead of -v flag.

maksadbek commented Apr 19, 2017

@cpuguy83
What do you recommend to implement this with caching on the start?

For the prototype, I was intended to make a template for the "namespaces" flag, and run stat util on each ps command to gather info(this is what the bash script does)

Earlier @brendangregg suggested using -N|--namespaces instead of -v flag.

@fabiokung

This comment has been minimized.

Show comment
Hide comment
@fabiokung

fabiokung Apr 24, 2017

Contributor

+1 -N|--namespaces

-s|--size is also expensive and works in a similar way.

Contributor

fabiokung commented Apr 24, 2017

+1 -N|--namespaces

-s|--size is also expensive and works in a similar way.

@fabiokung

This comment has been minimized.

Show comment
Hide comment
@fabiokung

fabiokung Apr 24, 2017

Contributor

@maksadbek watch out if #31273 gets merged, rebasing your patches may require a considerable effort.

Contributor

fabiokung commented Apr 24, 2017

@maksadbek watch out if #31273 gets merged, rebasing your patches may require a considerable effort.

@maksadbek

This comment has been minimized.

Show comment
Hide comment
@maksadbek

maksadbek Apr 24, 2017

@fabiokung Okay, Thanks for notification :)

maksadbek commented Apr 24, 2017

@fabiokung Okay, Thanks for notification :)

@maksadbek

This comment has been minimized.

Show comment
Hide comment
@maksadbek

maksadbek May 24, 2017

The cli part is split from moby project and it seems this feature does not regard to this repo.
I see no reason to wait #31273 and I will submit PR to github.com/docker/cli repo.

maksadbek commented May 24, 2017

The cli part is split from moby project and it seems this feature does not regard to this repo.
I see no reason to wait #31273 and I will submit PR to github.com/docker/cli repo.

@pramodhkp

This comment has been minimized.

Show comment
Hide comment
@pramodhkp

pramodhkp Sep 20, 2017

@maksadbek Hi, any progress on this? I would like to give this a try, if not.

pramodhkp commented Sep 20, 2017

@maksadbek Hi, any progress on this? I would like to give this a try, if not.

@maksadbek

This comment has been minimized.

Show comment
Hide comment
@maksadbek

maksadbek Sep 20, 2017

@pramodhkp hello, please follow the link to the issue above, I think this was already implemented and merged.

maksadbek commented Sep 20, 2017

@pramodhkp hello, please follow the link to the issue above, I think this was already implemented and merged.

@0xbasiX

This comment has been minimized.

Show comment
Hide comment
@0xbasiX

0xbasiX Oct 2, 2017

Hmmm...@maksadbek, thinking I'm missing something but should the status of this issue be updated then?

0xbasiX commented Oct 2, 2017

Hmmm...@maksadbek, thinking I'm missing something but should the status of this issue be updated then?

@cpuguy83

This comment has been minimized.

Show comment
Hide comment
@cpuguy83

cpuguy83 Oct 2, 2017

Contributor

This is not implemented.

Contributor

cpuguy83 commented Oct 2, 2017

This is not implemented.

@rusrushal13

This comment has been minimized.

Show comment
Hide comment
@rusrushal13

rusrushal13 Oct 28, 2017

Is this issue is implemented or not, If not I would like to work on it.

rusrushal13 commented Oct 28, 2017

Is this issue is implemented or not, If not I would like to work on it.

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Oct 28, 2017

Member

removed comment from @luckygoodness, which looks to be a spam account

Member

thaJeztah commented Oct 28, 2017

removed comment from @luckygoodness, which looks to be a spam account

@moby moby deleted a comment Oct 28, 2017

@pushpankar

This comment has been minimized.

Show comment
Hide comment
@pushpankar

pushpankar Dec 30, 2017

Hello. Should I take this?

pushpankar commented Dec 30, 2017

Hello. Should I take this?

@maksadbek

This comment has been minimized.

Show comment
Hide comment
@maksadbek

maksadbek Dec 30, 2017

Hi @pushpankar
I am already finishing the work on this feature and going to send PR soon.

maksadbek commented Dec 30, 2017

Hi @pushpankar
I am already finishing the work on this feature and going to send PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment