{"id":13503271,"url":"https://github.com/sameersbn/docker-mongodb","last_synced_at":"2026-03-11T06:31:10.873Z","repository":{"id":16141083,"uuid":"18886564","full_name":"sameersbn/docker-mongodb","owner":"sameersbn","description":"Dockerfile to build a MongoDb container image which can be linked to other containers.","archived":false,"fork":false,"pushed_at":"2016-01-26T04:47:27.000Z","size":46,"stargazers_count":48,"open_issues_count":1,"forks_count":50,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-09T07:45:28.648Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Psiphon-Labs/psiphon-chrome","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sameersbn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-17T17:06:19.000Z","updated_at":"2025-02-03T22:39:43.000Z","dependencies_parsed_at":"2022-09-02T21:02:49.629Z","dependency_job_id":null,"html_url":"https://github.com/sameersbn/docker-mongodb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sameersbn/docker-mongodb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameersbn%2Fdocker-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameersbn%2Fdocker-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameersbn%2Fdocker-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameersbn%2Fdocker-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sameersbn","download_url":"https://codeload.github.com/sameersbn/docker-mongodb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameersbn%2Fdocker-mongodb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30373440,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T22:02:44.227Z","updated_at":"2026-03-11T06:31:10.229Z","avatar_url":"https://github.com/sameersbn.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"[![Circle CI](https://circleci.com/gh/sameersbn/docker-mongodb.svg?style=shield)](https://circleci.com/gh/sameersbn/docker-mongodb) [![Docker Repository on Quay.io](https://quay.io/repository/sameersbn/mongodb/status \"Docker Repository on Quay.io\")](https://quay.io/repository/sameersbn/mongodb)\n\n\u003e **NOTICE**:\n\u003e\n\u003e Active maintenance of the image has been halted. Your [contributions](#contributing) are welcome.\n\n# sameersbn/mongodb:latest\n\n- [Introduction](#introduction)\n  - [Contributing](#contributing)\n  - [Issues](#issues)\n- [Getting started](#getting-started)\n  - [Installation](#installation)\n  - [Quickstart](#quickstart)\n  - [Command-line arguments](#command-line-arguments)\n  - [Persistence](#persistence)\n  - [Logs](#logs)\n- [Maintenance](#maintenance)\n  - [Upgrading](#upgrading)\n  - [Shell Access](#shell-access)\n\n# Introduction\n\n`Dockerfile` to create a [Docker](https://www.docker.com/) container image for [MongoDB](https://www.mongodb.org/).\n\nMongoDB is a cross-platform document-oriented database. Classified as a NoSQL database, MongoDB eschews the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas, making the integration of data in certain types of applications easier and faster\n\n## Contributing\n\nIf you find this image useful here's how you can help:\n\n- Send a pull request with your awesome features and bug fixes\n- Help users resolve their [issues](../../issues?q=is%3Aopen+is%3Aissue).\n- Support the development of this image with a [donation](http://www.damagehead.com/donate/)\n\n## Issues\n\nBefore reporting your issue please try updating Docker to the latest version and check if it resolves the issue. Refer to the Docker [installation guide](https://docs.docker.com/installation) for instructions.\n\nSELinux users should try disabling SELinux using the command `setenforce 0` to see if it resolves the issue.\n\nIf the above recommendations do not help then [report your issue](../../issues/new) along with the following information:\n\n- Output of the `docker version` and `docker info` commands\n- The `docker run` command or `docker-compose.yml` used to start the image. Mask out the sensitive bits.\n- Please state if you are using [Boot2Docker](http://www.boot2docker.io), [VirtualBox](https://www.virtualbox.org), etc.\n\n# Getting started\n\n## Installation\n\nAutomated builds of the image are available on [Dockerhub](https://hub.docker.com/r/sameersbn/mongodb) and is the recommended method of installation.\n\n\u003e **Note**: Builds are also available on [Quay.io](https://quay.io/repository/sameersbn/mongodb)\n\n```bash\ndocker pull sameersbn/mongodb:latest\n```\n\nAlternatively you can build the image yourself.\n\n```bash\ndocker build -t sameersbn/mongodb github.com/sameersbn/docker-mongodb\n```\n\n## Quickstart\n\nStart MongoDB using:\n\n```bash\ndocker run --name mongodb -d --restart=always \\\n  --publish 27017:27017 \\\n  --volume /srv/docker/mongodb:/var/lib/mongodb \\\n  sameersbn/mongodb:latest\n```\n\n*Alternatively, you can use the sample [docker-compose.yml](docker-compose.yml) file to start the container using [Docker Compose](https://docs.docker.com/compose/)*\n\n## Command-line arguments\n\nYou can customize the launch command of the MongoDB server by specifying arguments to `mongod` on the `docker run` command. For example the following command prints the help menu of `mongod` command:\n\n```bash\ndocker run --name mongodb -it --rm \\\n  --publish 27017:27017 \\\n  --volume /srv/docker/mongodb:/var/lib/mongodb \\\n  sameersbn/mongodb:latest --help\n```\n\n## Persistence\n\nFor MongoDB to preserve its state across container shutdown and startup you should mount a volume at `/var/lib/mongodb`.\n\n\u003e *The [Quickstart](#quickstart) command already mounts a volume for persistence.*\n\nSELinux users should update the security context of the host mountpoint so that it plays nicely with Docker:\n\n```bash\nmkdir -p /srv/docker/mongodb\nchcon -Rt svirt_sandbox_file_t /srv/docker/mongodb\n```\n\n## Logs\n\nTo access the MongoDB logs, located at `/var/log/mongodb`, you can use `docker exec`. For example, if you want to tail the logs:\n\n```bash\ndocker exec -it mongodb tail -f /var/log/mongodb/mongod.log\n```\n## Host UID / GID Mapping\nPer default the container is configured to run mongodb as user and group `mongodb` with `uid` `102` and `gid` `65534`. The host possibly uses this ids for different purposes leading to unfavorable effects. From the host it appears as if the mounted data volumes are owned by the host's user `102 and group `65534`.\n\nAlso the container processes seem to be executed as this host's user/group. The container can be configured to map the `uid` and `gid` of `mongodb` to different ids on host by passing the environment variables `USERMAP_UID` and `USERMAP_GID`. The following command maps the ids to user and group `mongodb` on the host.\n\n```bash\ndocker run --name mongodb -it --rm [options] \\\n    --env \"USERMAP_UID=$(id -u mongodb)\" --env \"USERMAP_GID=$(id -g mongodb)\" \\\n    sameersbn/mongodb:latest\n```\n\n\n# Maintenance\n\n## Upgrading\n\nTo upgrade to newer releases:\n\n  1. Download the updated Docker image:\n\n  ```bash\n  docker pull sameersbn/mongodb:latest\n  ```\n\n  2. Stop the currently running image:\n\n  ```bash\n  docker stop mongodb\n  ```\n\n  3. Remove the stopped container\n\n  ```bash\n  docker rm -v mongodb\n  ```\n\n  4. Start the updated image\n\n  ```bash\n  docker run -name mongodb -d \\\n    [OPTIONS] \\\n    sameersbn/mongodb:latest\n  ```\n\n## Shell Access\n\nFor debugging and maintenance purposes you may want access the containers shell. If you are using Docker version `1.3.0` or higher you can access a running containers shell by starting `bash` using `docker exec`:\n\n```bash\ndocker exec -it mongodb bash\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsameersbn%2Fdocker-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsameersbn%2Fdocker-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsameersbn%2Fdocker-mongodb/lists"}