Docker Community Forums

Share and learn in the Docker community.

Get base OS username from within container


(Kumuthini) #1

Is there a way to get the user that exec-ed into a container from within the container?

e.g. I want to run a script from within a container where people log in as root, but I want that script to know the username of the individual that “docker exec /bin/bash”-ed from base OS into container.