Sign inSign up

gagalkoding/openldap

By gagalkoding

•Updated 5 months ago

OpenLDAP container built from upstream OpenLDAP source with Bitnami migration compatibility

Image
0

415

gagalkoding/openldap repository overview

⁠OpenLDAP

Community-maintained OpenLDAP container built from official OpenLDAP source with migration-friendly compatibility for Bitnami OpenLDAP deployments.

⁠Features

  • OpenLDAP 2.6.13 from official source
  • Multi-stage Docker build
  • MDB backend support
  • Overlay module support
  • pw-sha2 password module support
  • OpenSSL TLS support
  • Cyrus SASL support
  • Non-root runtime
  • Healthcheck support
  • Bitnami migration compatibility
  • Existing slapd.d compatibility
  • Existing MDB database compatibility
  • Existing pw-sha2 compatibility
  • Existing overlay compatibility

⁠Supported Architecture

  • linux/amd64
  • linux/arm64

⁠Included Overlay Modules

Production-ready overlay modules included:

  • memberof
  • refint
  • syncprov
  • ppolicy
  • dynlist
  • unique
  • constraint
  • auditlog
  • translucent
  • valsort
  • rwm

⁠Included Password Modules

  • pw-sha2

Supported password schemes:

  • {SSHA512}
  • {SHA512}

⁠Quick Start

⁠Docker Compose

services:
  openldap:
    image: gagalkoding/openldap:latest
    container_name: openldap
    restart: unless-stopped

    environment:
      LDAP_ROOT: dc=example,dc=com
      LDAP_ADMIN_USERNAME: admin
      LDAP_ADMIN_PASSWORD: adminpassword
      LDAP_ADMIN_DN: cn=admin,dc=example,dc=com

    volumes:
      - ./ldap-data:/openldap

    ports:
      - "1389:1389"
      - "1636:1636"

Start container:

docker compose up -d

⁠Default Ports

PortDescription
1389LDAP
1636LDAPS

⁠Persistent Data

Container data stored in:

/openldap

Structure:

/openldap
├── data
└── slapd.d

⁠Environment Variables

VariableDefaultDescription
LDAP_ROOTdc=example,dc=comLDAP base DN
LDAP_ADMIN_USERNAMEadminLDAP admin username
LDAP_ADMIN_PASSWORDadminLDAP admin password
LDAP_ADMIN_DNcn=admin,dc=example,dc=comLDAP admin DN
LDAP_MDB_MAXSIZE1073741824MDB maximum database size

⁠Migration from Bitnami OpenLDAP

This image is designed to support migration from:

bitnami/openldap

⁠Supported Compatibility

  • Existing slapd.d
  • Existing MDB database
  • Existing overlays
  • Existing pw-sha2
  • Existing module paths
  • Existing Bitnami runtime paths

⁠Example Migration

⁠Existing Bitnami Compose

services:
  openldap:
    image: bitnami/openldap:2.6.10

    volumes:
      - ./ldap-data:/bitnami/openldap

⁠New Compose

services:
  openldap:
    image: gagalkoding/openldap:latest

    volumes:
      - ./ldap-data/data:/openldap/data
      - ./ldap-data/slapd.d:/openldap/slapd.d

⁠Verify LDAP

ldapsearch \
  -x \
  -H ldap://127.0.0.1:1389 \
  -D "cn=admin,dc=example,dc=com" \
  -w 'adminpassword' \
  -b "dc=example,dc=com"

⁠Generate SSHA512 Password

docker exec -it openldap \
  bash
export LDAP_MODULES_PATH=/opt/openldap-runtime/libexec/openldap
/opt/openldap-runtime/sbin/slappasswd \
  -o module-path=${LDAP_MODULES_PATH} \
  -o module-load=pw-sha2 \
  -h '{SSHA512}'

⁠Healthcheck

Container includes built-in healthcheck:

ldapsearch -x -H ldap://127.0.0.1:1389 -b "" -s base

⁠Backup

⁠Export Database

docker exec openldap \
  /opt/openldap-runtime/sbin/slapcat -n 1

⁠Export Configuration

docker exec openldap \
  /opt/openldap-runtime/sbin/slapcat -n 0

⁠Restore

⁠Restore Database

slapadd -n 1

⁠Restore Configuration

slapadd -n 0

⁠Build

docker build \
  -t gagalkoding/openldap:latest \
  -f docker/Dockerfile .

⁠Multi-Arch Build

docker buildx build \
  --platform linux/amd64,linux/arm64 \
  -t gagalkoding/openldap:latest \
  --push .

⁠Security Notes

  • Runs as non-root user
  • Official OpenLDAP source build
  • Minimal runtime image
  • Multi-stage Docker build
  • MDB backend only
  • Dynamic overlay modules enabled

⁠Project Goals

  • Clean OpenLDAP runtime
  • Migration-friendly architecture
  • Bitnami compatibility
  • Official source build
  • Production-grade container lifecycle
  • Enterprise-friendly deployment model

⁠License

MIT


⁠Acknowledgements

  • OpenLDAP Project
  • OpenLDAP Community
  • Bitnami OpenLDAP

Tag summary

Content type

Image

Digest

sha256:4063ab45a…

Size

35.2 MB

Last updated

5 months ago

docker pull gagalkoding/openldap