Sign inSign up

11notes/mongodb

By 11notes

โ€ขUpdated 7 months ago

run mongodb rootless

Buildkit cache
Image
0

3.7K

11notes/mongodb repository overview

banner

โ MONGODB

size5pxpulls5px5pxswiss_made

run mongodb rootless

โ INTRODUCTION ๐Ÿ“ข

MongoDBโ  (created by mongodbโ ) the popular, open-source NoSQL document-oriented database designed for handling large volumes of unstructured or semi-structured data. Unlike traditional relational databases (RDBMS) that use tables, MongoDB stores data in flexible, JSON-like BSON documents (Binary JSON). It is highly scalable, supports rapid development, and is widely used for modern web and mobile applications.

โ SYNOPSIS ๐Ÿ“–

What can I do with this? This image will run mongodb rootless withouth any authentication. Why so simple? Because 99.9% of all containers that need mongodb, are happy with the default settings, no different dbuser, whatever needed. It also adds a simple backup scheduler that will backup your database if MONGODB_BACKUP_SCHEDULE is set, including a retention manager. Since this image has by default no authentication, you must make sure itโ€™s only reachable via an internal: true network and only attach containers to the same network that need direct access to MongoDB. This image is also skipping all informal logs to quiet it down and only show errors.

Supported MongoDB versions: 4.4.30 (EOL, but no AVX required from your CPU)

โ UNIQUE VALUE PROPOSITION ๐Ÿ’ถ

Why should I run this image and not the other image(s) that already exist? Good question! Because ...

  • ... this image runs rootlessโ  as 1000:1000
  • ... this image has a health check
  • ... this image runs read-only
  • ... this image is created via a secure and pinned CI/CD process
  • ... this image is very small
  • ... this image can take full backups on its own

If you value security, simplicity and optimizations to the extreme, then this image might be for you.

โ COMPARISON ๐Ÿ

Below you find a comparison between this image and the most used or original one.

imagesize on diskinit default asdistrolessโ supported architectures
11notes/mongodb175MB1000:1000โŒamd64, arm64
mongo409MB0:0โŒamd64, arm64v8

โ VOLUMES ๐Ÿ“

  • /mongodb/var - Directory of database files
  • /mongodb/backup - Directory of backups

โ COMPOSE โœ‚๏ธ

name: "db"

x-lockdown: &lockdown
  # prevents write access to the image itself
  read_only: true
  # prevents any process within the container to gain more privileges
  security_opt:
    - "no-new-privileges=true"

services:
  mongodb:
    image: "11notes/mongodb:4.4.30"
    <<: *lockdown
    environment:
      TZ: "Europe/Zurich"
      # make a full database backup each day at 03:00
      MONGODB_BACKUP_SCHEDULE: "0 3 * * *"
      # only keep the last five backups
      MONGODB_BACKUP_RETENTION: 5
    networks:
      backend:
    volumes:
      - "mongodb.var:/mongodb/var"
      - "mongodb.backup:/mongodb/backup"
    restart: "always"

volumes:
  mongodb.var:
  mongodb.backup:

networks:
  backend:
    internal: true

To find out how you can change the default UID/GID of this container image, consult the RTFMโ .

โ DEFAULT SETTINGS ๐Ÿ—ƒ๏ธ

ParameterValueDescription
userdockeruser name
uid1000user identifierโ 
gid1000group identifierโ 
home/mongodbhome directory of user docker

โ ENVIRONMENT ๐Ÿ“

ParameterValueDefault
TZTime Zoneโ 
DEBUGWill activate debug option for container image and app (if available)
MONGODB_BACKUP_SCHEDULE (optional)Set backup schedule for full backups (crontab style)
MONGODB_BACKUP_RETENTION (optional)Set backup retention points to keep0 (disabled)

โ MAIN TAGS ๐Ÿท๏ธ

These are the main tags for the image. There is also a tag for each commit and its shorthand sha256 value.

โ There is no latest tag, what am I supposed to do about updates?

It is my opinion that the :latest tag is a bad habbit and should not be used at all. Many developers introduce breaking changes in new releases. This would messed up everything for people who use :latest. If you donโ€™t want to change the tag to the latest semverโ , simply use the short versions of semverโ . Instead of using :4.4.30 you can use :4 or :4.4. Since on each new version these tags are updated to the latest version of the software, using them is identical to using :latest but at least fixed to a major or minor version. Which in theory should not introduce breaking changes.

If you still insist on having the bleeding edge release of this app, simply use the :rolling tag, but be warned! You will get the latest version of the app instantly, regardless of breaking changes or security issues or what so ever. You do this at your own risk!

โ REGISTRIES โ˜๏ธ

docker pull 11notes/mongodb:4.4.30
docker pull ghcr.io/11notes/mongodb:4.4.30
docker pull quay.io/11notes/mongodb:4.4.30

โ UNRAID VERSION ๐ŸŸ 

This image supports unraid by default. Simply add -unraid to any tag and the image will run as 99:100 instead of 1000:1000.

โ NOBODY VERSION ๐Ÿ‘ป

This image supports nobody by default. Simply add -nobody to any tag and the image will run as 65534:65534 instead of 1000:1000.

โ SOURCE ๐Ÿ’พ

โ PARENT IMAGE ๐Ÿ›๏ธ

โ BUILT WITH ๐Ÿงฐ

โ GENERAL TIPS ๐Ÿ“Œ

  • Use a reverse proxy like Traefik, Nginx, HAproxy to terminate TLS and to protect your endpoints
  • Use Letโ€™s Encrypt DNS-01 challenge to obtain valid SSL certificates for your services

โ CAUTION โš ๏ธ

  • Do not expose the EOL version to anything except the app that requires it. Use internal: true docker or container networks only!

โ ElevenNotesโ„ข๏ธ

This image is provided to you at your own risk. Always make backups before updating an image to a different version. Check the releasesโ  for breaking changes. If you have any problems with using this image simply raise an issueโ , thanks. If you have a question or inputs please create a new discussionโ  instead of an issue. You can find all my other repositories on githubโ .

created 30.03.2026, 11:42:31 (CET)

Tag summary

Content type

Image

Digest

sha256:cb543d456โ€ฆ

Size

113.2 MB

Last updated

7 months ago

docker pull 11notes/mongodb:4.4.30-nobody