Sign inSign up
mongo logo

epicmorg/mongo

By epicmorg

•Updated about 14 hours ago

MongoDB 1.2-9.0 (vendor binaries, TLS on baked OpenSSL), drop-in for library/mongo

Image
0

9.5K

epicmorg/mongo repository overview

⁠epicmorg/mongo

MongoDB from MongoDB's own prebuilt binaries (fastdl.mongodb.org, sha256-checked) on Debian 13 trixie, one tag per release line at its newest patch, from 1.2 to 9.0. The entrypoint is a drop-in for library/mongo (MONGO_INITDB_*, /docker-entrypoint-initdb.d, /data/db, uid 999) and understands the common bitnami/mongodb variables too. MongoDB itself is not built from source (SCons / its own toolchain, hours and tens of GB of RAM per build); what is ours: the base, the TLS stacks the old binaries need, the entrypoint and the fatal checks.

⁠What's inside

LinesVendor buildTLS
1.2-2.6generic "legacy"none (no Debian/Ubuntu TLS builds exist; libc only)
3.0-3.6ubuntu1604OpenSSL 1.0.2g built from Ubuntu 16.04's source package (all its patches incl. the symbol-version script and security fixes)
4.0-5.0 (+ 4.1)ubuntu1804 / debian10 / debian11baked OpenSSL 1.1.1 + curl 8.17 + openldap 2.6 / cyrus-sasl 2.1 built against it
6.0-9.0ubuntu2204 / debian12 / debian13Debian's OpenSSL 3
  • mongod, mongos and the tarball's tools in /usr/local/share/epicmorg/mongo/<major.minor>/bin, on PATH; legacy mongo shell up to 5.0; mongosh (2.x) for 6.0+; MongoDB Database Tools (100.x) for 4.4+;
  • baked stacks are wired into the vendor ELF files with patchelf --force-rpath (DT_RPATH, so it also covers the libraries they load) - nothing in ld.so.conf; /emg-export has mongo + the prefixes it links for COPY --from;
  • entrypoint under tini, gosu, numactl (interleave when available); volumes /data/db, /data/configdb; port 27017.

Fatal build-time checks: the release, no unresolved libraries, at most one libssl per binary and - per line - none / the baked one / Debian's, no OpenSSL 3 in the 1.x-TLS mongod, and a smoke test: first-start initialisation with a root user, listDatabases with and without credentials, and a TLS listener.

⁠Variables

VariableMeaning
MONGO_INITDB_ROOT_USERNAME / _PASSWORD (_FILE)root user created on the first start (empty dbpath); then --auth
MONGO_INITDB_DATABASEdatabase for /docker-entrypoint-initdb.d/*.js (default test); *.sh are sourced
MONGODB_ROOT_USER (root) / MONGODB_ROOT_PASSWORD (_FILE)bitnami names for the root user
MONGODB_USERNAME / MONGODB_PASSWORD (_FILE) / MONGODB_DATABASEbitnami: an extra readWrite user in that database
MONGODB_PORT_NUMBERbitnami: --port
MONGODB_EXTRA_FLAGSbitnami: extra mongod flags (word-split)

A mounted /bitnami/mongodb becomes --dbpath /bitnami/mongodb/data/db. Arguments starting with - go to mongod; any other command (mongosh, mongodump, bash) runs as is. 3.6+ get --bind_ip_all unless you pass a bind option or a config file. Users are created with db.createUser (2.6+) or db.addUser (older).

⁠Tags

TagsDockerfile
1.2, 1.2.51.2⁠
1.4, 1.4.51.4⁠
1.6, 1.6.51.6⁠
1.8, 1.8.5, 11.8⁠
2.0, 2.0.92.0⁠
2.2, 2.2.72.2⁠
2.4, 2.4.142.4⁠
2.6, 2.6.12, 22.6⁠
3.0, 3.0.153.0⁠
3.2, 3.2.223.2⁠
3.4, 3.4.243.4⁠
3.6, 3.6.23, 33.6⁠
4.0, 4.0.284.0⁠
4.1, 4.1.134.1⁠
4.2, 4.2.254.2⁠
4.4, 4.4.31, 44.4⁠
5.0, 5.0.34, 55.0⁠
6.0, 6.0.29, 66.0⁠
7.0, 7.0.45, 77.0⁠
8.0, 8.0.348.0⁠
8.2, 8.2.12, 88.2⁠
9.0, 9.0.4, 9, latest9.0⁠

Every tag is pushed to docker.io, quay.io and ghcr.io (epicmorg/mongo:<tag> on each) - same digest everywhere.

⁠Usage

services:
  mongo:
    image: epicmorg/mongo:8.2          # was: mongo:8.2 - environment and volumes unchanged
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD_FILE: /run/secrets/mongo-root
    volumes:
      - ./db:/data/db
      - ./initdb:/docker-entrypoint-initdb.d:ro
    secrets: [mongo-root]
secrets:
  mongo-root:
    file: ./mongo-root.txt

⁠Notes

  • 1.0 is not provided: its mongod has no --fork / --logpath (the first-start initialisation needs them). 1.6 is 1.6.5 (1.6.6 is gone from fastdl). mongosniff (1.x-2.4, needs libpcap 0.9) is dropped.
  • Old lines (everything before 7.0) are end-of-life upstream; they are here for data that has to be read or migrated, not for new deployments. Upgrade a data directory one major line at a time.
  • Licences: MongoDB up to 4.0.3 is AGPLv3, later releases SSPL; the image recipe is MIT.

Folders are written by bin/python/mongo-versions-sync.py; the entrypoint lives once in docker-entrypoint.sh⁠ and is copied into each folder.

Tag summary

Content type

Image

Digest

sha256:ba0aaf4f6…

Size

948.6 MB

Last updated

about 14 hours ago

docker pull epicmorg/mongo:3.4.24