Dockerfile to build a MongoDB container image, based on the official MongoDB docker image. This image however does not properly map the user and group ID of the mongodb user, to the user and group ID on the host. As a result, files in shared volumes will be inaccessible by the host user.
The quickest way to get started is using docker-compose.
wget https://raw.githubusercontent.com/OpenTriply/docker-mongodb/3.2.0-1/docker-compose.yml
Start MongoDB using
docker-compose up
In addition to the official image, this image provides these environment variables
- DEBUG: Set this to
true
to enable entrypoint debugging. - USERMAP_UID: Sets the user ID for user
mongodb
to the specified user ID. Defaults to1000
. - USERMAP_GID: Sets the group ID for user
mongodb
to the specified group ID. Defaults to1000
.