Docker Community Forums

Share and learn in the Docker community.

Docker default user for running containers?


(Chris1284) #1

Hi,

i have installed docker as root and has created a plex container from plexinc/pms-docker image as root.
if i start the container, top shows that the plex media server runs as user “christian”.
With docker inspect i can see that the option user empty. Is this normal? Can i change the user for this existing container to “plex” (edit config.v2.json?)? could it be that this a behavior which is based on the image? The nextcloud container seems to run as root. Could it be that the container user is 1000 and top (on host) shows name christian because this is the uid of this user on the host?

Hostos: Linux Debian Stretch 4.9.88
Docker: 18.03.1-ce

thank you

christian


(Chris1284) #2

Ok, it seems to be like i thought. in the container user id 1000 is plex, on host 1000 is christian so top /ps translate it with christian. has this container all rights of christian on the host?


(David Maze) #3

I’m pretty sure it can’t reach outside its own process space, and it can’t see anything in the filesystem you don’t explicitly give it access to. So in that sense it’s limited. (It can’t control your desktop applications, because those go through a Unix socket, which isn’t generally mounted into a container, for instance.)

If you did something like docker run -v /:/host and published your entire root filesystem into the container, then it could see and change anything the host user with the same uid could.