Sign inSign up

stefda/mongo

By stefda

Updated over 9 years ago

Mongo image override

Image
0

162

stefda/mongo repository overview

mongo

An override of the official mongo image that allows to set up username, password and database via docker-compose environment variables.

Usage

An example docker-compose.yml looks like this:

version: '2'
services:
  mongo:
    image: stefda/mongo
    environment:
      USERNAME: myusername
      PASSWORD: mypassword
      DATABASE: mydatabase
    ports:
      - 27017:27017

To connect, one must authenticate against the admin database:

mongo --host <docker_ip> --authenticationDatabase admin -u myusername -p mypassword mydatabase 

Tag summary

Content type

Image

Digest

Size

125.8 MB

Last updated

over 9 years ago

docker pull stefda/mongo