Sign inSign up

nachetecanon/mongodb_secured

By nachetecanon

•Updated over 9 years ago

mongodb image with admin user configured

Image
0

170

nachetecanon/mongodb_secured repository overview

⁠MongoDB docker image

This image is based upon the original/official image from MongoDB at GitHub⁠ using the 3.4 version.

⁠Security

The original image has been altered in order to setup a basic user/password security scheme, so admin user is created and set up with mongoAdmin user and a generated password that can be found at /srv/mongodb/pwd file.

⁠Use

You can run the image like this

mongo -u "mongoAdmin" -p "tdhrqPcCvdU+0HWEcg==" --authenticationDatabase "admin"

Then create the database/s and user/s you want,

>use newDatabase
>db.createUser({
      user: "john",
      pwd: "jomKeagAcmeaj7OftIrfegHok",
      roles: [
        { role: "readWrite", db: "newDatabase" }
      ]
      })

exit and test to enter again with the new u/p/database

mongo -u "john" -p "jomKeagAcmeaj7OftIrfegHok" newDatabase

⁠Other params

You can use this image the same as the original, following the official docs⁠, the only difference is that an admin user will be created and given permissions to the following roles:

  • userAdminAnyDatabase

  • dbAdminAnyDatabase

  • readWriteAnyDatabase

  • clusterAdmin

Tag summary

Content type

Image

Digest

Size

125.9 MB

Last updated

over 9 years ago

docker pull nachetecanon/mongodb_secured:develop