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 founder Solomon Hykes at DockerCon. Solomon Hykes built a wonky open-source project a decade ago that later took on the name Docker and attained a private market valuation of over $1 billion.
By default, a Docker Container runs as a Root user.
Docker inspect provides detailed information on constructs controlled by Docker. By default, docker inspect will render results in a JSON array. For example uses of this command, refer to the examples section below.
You can try this;
docker inspect $(docker ps -q) --format '{{.Config.User}} {{.Name}}'
Edit: Container name added to output
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With