Luc Juggery
1 min readJun 6, 2019

--

Hi Issac,

in fact, the “whoami” command (the one that is run when you do the exec) is running as root. The mongod process running in the container has the PID 1 and is running with the user mongodb (created in the Dockerfile of mongodb).

gosu is used to change the owner from root to mongodb when the docker-entrypoint.sh script is done.

Does that help ?

Luc

--

--

Luc Juggery
Luc Juggery

Written by Luc Juggery

Docker & Kubernetes trainer (CKA / CKAD), 中文学生, Learning&Sharing

No responses yet