Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I see which user launched a Docker container?

Tags:

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.

like image 576
Franck Dernoncourt Avatar asked May 27 '18 05:05

Franck Dernoncourt


People also ask

Who created docker container?

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.

What user does docker run as by default?

By default, a Docker Container runs as a Root user.

Which command is used to find docker details?

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.


1 Answers

You can try this;

docker inspect $(docker ps -q) --format '{{.Config.User}} {{.Name}}' 

Edit: Container name added to output

like image 184
Anar Bayramov Avatar answered Oct 13 '22 13:10

Anar Bayramov