How docker-library/mongo works
Project type and purpose
• This is an “Official Image” Git repository for MongoDB Docker images. It contains everything needed to build, test, and publish MongoDB containers for multiple versions (6.0, 7.0, 8.0) on both Linux and various Windows bases.
• Its purpose is to:
• Maintain versioned Dockerfiles (and Windows variants)
• Use templates + scripts to generate final Dockerfiles and Docker-Hub metadata
• Run CI to lint, validate and test those images
• Push built images to Docker Hub as the “source of truth” for the mongo official image
File structure
• Top-level:
• Dockerfile-linux.template / Dockerfile-windows.template – generic templates
• apply-templates.sh – applies templates for all versions
• generate-stackbrew-library.sh – produces the library file used by official-images
• versions.json / versions.sh – declare supported MongoDB versions and variants
• pgp-keys.json / pgp-keys.sh – manage MongoDB signing keys
• .github/workflows/ci.yml & verify-templating.yml – define GitHub Actions jobs
• Version directories (6.0, 6.0-rc, 7.0, 7.0-rc, 8.0, 8.0-rc):
• Each has its own Dockerfile (overrides from template) and docker-entrypoint.sh
• A nested windows/ folder with nanoserver and windowsservercore Dockerfiles
• CI config:
• ci.yml runs lint, build, and test matrix for linux + Windows
• verify-templating.yml ensures templates are correctly applied
README for additional insights
• Confirms this is an Official Image repo
• Points to external “official-images” and “docs” repos for published metadata and long form docs