title: File permission issue with mongo docker image
body: <p>I'm trying to instanciate a mongodb docker image using the following commmand:</p>
  
  <pre><code>docker run -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=password mongo
  </code></pre>
  
  <p>The command fails instantly because of a <strong>Persmission denied</strong>:</p>
  
  <pre><code>2019-11-12T20:16:29.503+0000 I  CONTROL  [main] ERROR: Cannot write pid file to /tmp/docker-entrypoint-temp-mongod.pid: Permission denied
  </code></pre>
  
  <p>The weird thing is the same command works fine on some other machines that has the same users, groups... The only thing that differs is the docker version.</p>
  
  <p>I don't understand why the mongo instance does not run as I do not have any volumes or user specified on the command line.</p>
  
  <p>Here is my docker info</p>
  
  <pre><code>Client:
   Debug Mode: false
  Server:
   Containers: 29
    Running: 1
    Paused: 0
    Stopped: 28
   Images: 87
   Server Version: 19.03.4
   Storage Driver: overlay2
    Backing Filesystem: extfs
    Supports d_type: true
    Native Overlay Diff: true
   Logging Driver: json-file
   Cgroup Driver: cgroupfs
   Plugins:
    Volume: local
    Network: bridge host ipvlan macvlan null overlay
    Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
   Swarm: inactive
   Runtimes: runc
   Default Runtime: runc
   Init Binary: docker-init
   containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
   runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
   init version: fec3683
   Security Options:
    seccomp
     Profile: default
   Kernel Version: 4.9.0-11-amd64
   Operating System: Debian GNU/Linux 9 (stretch)
   OSType: linux
   Architecture: x86_64
   CPUs: 4
   Total Memory: 25.52GiB
   Name: jenkins-vm
   ID: YIGQ:YOVJ:2Y7F:LM77:VHK6:ICMY:QDGA:5EFD:ZYDD:EQM5:DR77:DANT
   Docker Root Dir: /data/var/lib/docker
   Debug Mode: false
   Registry: https://index.docker.io/v1/
   Labels:
   Experimental: false
   Insecure Registries:
    127.0.0.0/8
   Live Restore Enabled: false
  WARNING: No swap limit support
  </code></pre>
  
  <p>And as suggested by @jan-garaj, here is the result of <code>docker run -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=password mongo id</code>: uid=0(root) gid=0(root) groups=0(root)</p>
  
  <p>What could be the reason of this failure ?</p>