Public Repository

Last pushed: 9 months ago
Short Description
MongoDB image based on mongo official image with authentication for admin and application users.
Full Description

This image was created based on mongo official repository.
More details about how this image was created can be found on my blog.

The Dockerfile declares the following environment variables:
ENV AUTH yes
ENV STORAGE_ENGINE wiredTiger
ENV JOURNALING yes

The script creates an admin super user and an application user to the specified database. The database and credentials are pulled from the following environment variables:

MONGODB_ADMIN_USER
MONGODB_ADMIN_PASS
MONGODB_APPLICATION_DATABASE
MONGODB_APPLICATION_USER
MONGODB_APPLICATION_PASS

You can run it like this:

docker run -it \
-e MONGODB_ADMIN_USER=admin \
-e MONGODB_ADMIN_PASS=adminpass \
-e MONGODB_APPLICATION_DATABASE=mytestdatabase \
-e MONGODB_APPLICATION_USER=testuser \
-e MONGODB_APPLICATION_PASS=testpass \
-p 27017:27017 alexpunct/mongo:3.4
Docker Pull Command
Owner
alexpunct