Docker Community Forums

Share and learn in the Docker community.

Automatically run container under current user?


(Rgerhards) #1

I am creating an app container that shall run under the permissions of the user who starts it. I know this can be done by

docker run -u`id -u`:`id -g` ...

however, I would prefer not to put this chore onto the user but rather have it automatically applied as default for docker run. Is there any way to do this?

Background info: this container will potentially modify files in the users home directory, and I want to ensure that these are owned by the user in question. Else it probably gets pretty messy.

If you are interested: actual container def is it at https://github.com/rsyslog/rsyslog-doc/tree/master/tools/buildenv

Thanks,
Rainer