Luc Juggery
1 min readJun 4, 2019

--

Hi Issac, the mongod process should not be running as root if started with “docker run … mongo:4.0”. What result do you get for a “ps aux | grep mongo” on your host ? If you use the USER instruction in the Dockerfile or the -u flag on command line, the result is not the same as with gosu. Using gosu allows to do “root” stuff when the container is started and then to fall back to a non root user for the main (mongod) process. I hope this helps.

--

--

Luc Juggery
Luc Juggery

Written by Luc Juggery

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

Responses (1)