Find the user who started a docker container

We've got many users who belong to the docker group. So any of these users can start a docker container. docker ps will show me all the running containers, but it doesn't show me which user started the container. The dockerd log also doesn't appear to indicate which user call docker run. Is there any way to find out what user started a given container?

1 Answer

This worked for me:

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

My setup:

Host: Ubuntu 16.04

Docker version: 17.06.2-ce, build cec0b72

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like