I can view the list of running containers with docker ps
or equivalently docker container ls
(added in Docker 1.13). However, it doesn't display the user who launched each Docker container. How can I see which user launched a Docker container? Ideally I would prefer to have the list of running containers along with the user for launched each of them.
相关问题
- Docker task in Azure devops won't accept "$(pw
- Unable to run mariadb when mount volume
- Unspecified error (0x80004005) while running a Doc
- What would prevent code running in a Docker contai
- How to reload apache in php-apache docker containe
You can try this;
Edit: Container name added to output
If you are used to
ps
command, runningps
on the Docker host andgrep
with parts of the process your process is running. For example, if you have a Tomcat container running, you may run the following command to get details on which user would have started the container.This is possible because containers are nothing but processes managed by docker. However, this will only work on single host. Docker provides alternatives to get container details as mentioned in other answer.
Find the process's name (the one running inside the container) in the list (last column) and you will see the user ran it in the first column