From de4e8c71a00f77e6bb5046bfc5f54af02ee9ff97 Mon Sep 17 00:00:00 2001 From: Docker Library Bot Date: Mon, 22 Feb 2016 10:47:12 -0800 Subject: [PATCH] Run update.sh --- mageia/README.md | 5 ++--- mongo/README.md | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/mageia/README.md b/mageia/README.md index 7b679ad1..822a2d68 100644 --- a/mageia/README.md +++ b/mageia/README.md @@ -1,9 +1,8 @@ # Supported tags and respective `Dockerfile` links -- [`latest`, `5` (*5/Dockerfile*)](https://github.com/juanluisbaptiste/docker-brew-mageia/blob/0de4791998e295f9b71ff4d079dea424fe397853/5/Dockerfile) -- [`4` (*4/Dockerfile*)](https://github.com/juanluisbaptiste/docker-brew-mageia/blob/0de4791998e295f9b71ff4d079dea424fe397853/4/Dockerfile) +- [`latest`, `5` (*5/Dockerfile*)](https://github.com/juanluisbaptiste/docker-brew-mageia/blob/4da7cfe586ac0ef3fe3856d48d0410bf83c0cbe2/5/Dockerfile) -[![](https://badge.imagelayers.io/mageia:latest.svg)](https://imagelayers.io/?images=mageia:latest,mageia:4) +[![](https://badge.imagelayers.io/mageia:latest.svg)](https://imagelayers.io/?images=mageia:latest) For more information about this image and its history, please see [the relevant manifest file (`library/mageia`)](https://github.com/docker-library/official-images/blob/master/library/mageia). This image is updated via pull requests to [the `docker-library/official-images` GitHub repo](https://github.com/docker-library/official-images). diff --git a/mongo/README.md b/mongo/README.md index 1a04069a..87c36bcc 100644 --- a/mongo/README.md +++ b/mongo/README.md @@ -55,6 +55,41 @@ Just add the `--storageEngine` argument if you want to use the WiredTiger storag $ docker run --name some-mongo -d mongo --storageEngine wiredTiger ``` +### Authentication and Authorization + +MongoDB does not require authentication by default, but it can be configured to do so. For more details about the functionality described here, please see the sections in the official documentation which describe [authentication](https://docs.mongodb.org/manual/core/authentication/) and [authorization](https://docs.mongodb.org/manual/core/authorization/) in more detail. + +#### Start the Database + +```console +$ docker run --name some-mongo -d mongo --auth +``` + +#### Add the Initial Admin User + +```console +$ docker exec -it some-mongo mongo admin +connecting to: admin +> db.createUser({ user: 'jsmith', pwd: 'some-initial-password', roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] }); +Successfully added user: { + "user" : "jsmith", + "roles" : [ + { + "role" : "userAdminAnyDatabase", + "db" : "admin" + } + ] +} +``` + +#### Connect Externally + +```console +$ docker run -it --rm --link some-mongo:mongo mongo mongo -u jsmith -p some-initial-password --authenticationDatabase admin some-mongo/some-db +> db.getName(); +some-db +``` + ## Where to Store Data Important note: There are several ways to store data used by applications that run in Docker containers. We encourage users of the `mongo` images to familiarize themselves with the options available, including: