HUB
Sign inSign up
openldap logo

epicmorg/openldap

By epicmorg

•Updated about 5 hours ago

OpenLDAP 2.4-2.7 from source (baked OpenSSL + Cyrus SASL), drop-in for bitnami/openldap

Image
0

2.2K

epicmorg/openldap repository overview

⁠epicmorg/openldap

OpenLDAP slapd built from the openldap.org source tarballs (checked against openldap.org's own checksums) on Debian 13 trixie, one tag per release line at its newest patch. The entrypoint is a drop-in for bitnami/openldap: the same LDAP_* variables, the same mounts (/bitnami/openldap, /ldifs, /schemas, /docker-entrypoint-initdb.d), the same ports (1389 / 1636) and the same uid (1001) - switch the image: line of an existing bitnami compose service and keep its environment and volume.

⁠What's inside

LineStatus upstreamNotes
2.7feature release
2.6LTS - tags 2, latest
2.5previous LTS
2.4legacyback-bdb / back-hdb (Berkeley DB 5.3) for reading and migrating old databases; no argon2
  • slapd and the slap* tools, the ldap* clients in /usr/local/share/epicmorg/openldap/<major.minor>, on PATH; mdb and monitor built in, every overlay, back-ldap / meta / null / relay / dnssrv, argon2 and the contrib password modules pw-sha2 / pw-pbkdf2 as modules;
  • TLS on the baked OpenSSL 3.5 (LTS); SASL on a Cyrus SASL 2.1.28 built against the same OpenSSL (Debian's libsasl2 and its plugins link the system libcrypto) with GSSAPI from Debian's MIT Kerberos - real RPATH, nothing in ld.so.conf, exactly one OpenSSL in the process;
  • /emg-export - openldap + OpenSSL + Cyrus SASL as a self-contained tree for COPY --from;
  • entrypoint under tini; slapd runs as slapd (uid 1001, group root) when the container starts as root; ldapi:/// (SASL EXTERNAL) works for root and slapd in docker exec;
  • volume /data (native: data/ + slapd.d/) - /bitnami/openldap is used instead when it is mounted; /opt/bitnami/openldap/{libexec,lib/openldap,etc,var/run} point at this image, so a cn=config written by bitnami (module path, pid file) starts unchanged; HEALTHCHECK = a rootDSE search.

Fatal build-time checks: exact version of slapd and the clients, no unresolved libraries, no RUNPATH, every libssl / libcrypto / libsasl2 is the baked one, the overlays / backends / password modules / SASL plugins are there, PBKDF2 hashing works, and an entrypoint smoke test: first start, admin bind, default tree, user bind with its PBKDF2 password, ldaps, anonymous bind refused, ppolicy, restart on the persisted volume, refusal to start without LDAP_ADMIN_PASSWORD.

⁠Variables

As in bitnami/openldap; they are read on the first start (empty data directory) - later starts use the persisted cn=config.

VariableDefaultMeaning
LDAP_ROOTdc=example,dc=orgsuffix of the database (LDAP_SUFFIX overrides the suffix alone)
LDAP_ADMIN_USERNAMEadminroot DN cn=<name>,<root>
LDAP_ADMIN_PASSWORD (_FILE)(required)root DN password (stored as {PBKDF2-SHA512})
LDAP_CONFIG_ADMIN_ENABLED / _USERNAME / _PASSWORD (_FILE)no / admina root DN for cn=config
LDAP_USERS / LDAP_PASSWORDSuser01,user02 / bitnami1,bitnami2default tree users
LDAP_USER_OU / LDAP_GROUP_OU / LDAP_GROUPusers / groups / readersdefault tree
LDAP_SKIP_DEFAULT_TREEnoyes = no default tree
LDAP_ADD_SCHEMAS / LDAP_EXTRA_SCHEMASyes / cosine,inetorgperson,nisschemas from etc/openldap/schema
LDAP_CUSTOM_LDIF_DIR/ldifs*.ldif loaded instead of the default tree
LDAP_CUSTOM_SCHEMA_FILE / LDAP_CUSTOM_SCHEMA_DIR/schema/custom.ldif / /schemasextra schemas
LDAP_PORT_NUMBER / LDAP_LDAPS_PORT_NUMBER1389 / 1636listeners
LDAP_ENABLE_TLS / LDAP_REQUIRE_TLSno / noldaps:// + StartTLS; olcSecurity: tls=1
LDAP_TLS_CERT_FILE / _KEY_FILE / _CA_FILE / _DH_PARAMS_FILETLS files
LDAP_TLS_VERIFY_CLIENTSneverolcTLSVerifyClient
LDAP_ENABLE_PROXYPROTO / LDAP_PROXYPROTO_PORT_NUMBER / _LDAPS_PORT_NUMBERnoPROXY protocol listeners (pldap://, pldaps://)
LDAP_ALLOW_ANON_BINDINGnoyes = keep anonymous bind
LDAP_PASSWORD_HASH{SSHA}olcPasswordHash
LDAP_CONFIGURE_PPOLICY / LDAP_PPOLICY_USE_LOCKOUT / LDAP_PPOLICY_HASH_CLEARTEXTnoppolicy overlay
LDAP_ENABLE_ACCESSLOG + LDAP_ACCESSLOG_*noaccesslog database + overlay
LDAP_ENABLE_SYNCPROV / LDAP_SYNCPROV_CHECKPPOINT / _SESSIONLOGno / 100 10 / 100syncprov overlay (replication provider)
LDAP_LOGLEVEL256slapd -d
LDAP_ULIMIT_NOFILES1024ulimit -n

/docker-entrypoint-initdb.d/*.sh run once per volume, with slapd up on ldapi:///. Arguments starting with - go to slapd; any other command (ldapsearch, slapcat, bash) runs as is.

⁠Tags

TagsDockerfile
2.4, 2.4.592.4⁠
2.5, 2.5.202.5⁠
2.6, 2.6.15, 2, latest2.6⁠
2.7, 2.7.12.7⁠

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

⁠Usage

services:
  openldap:
    image: epicmorg/openldap:2.6          # was: bitnami/openldap:2.6 - environment and volume unchanged
    restart: always
    ports:
      - "389:1389"
      - "636:1636"
    environment:
      LDAP_ROOT: dc=example,dc=org
      LDAP_ADMIN_PASSWORD_FILE: /run/secrets/ldap-admin
      LDAP_SKIP_DEFAULT_TREE: "yes"
    volumes:
      - ./openldap:/bitnami/openldap
      - ./ldifs:/ldifs:ro
    secrets: [ldap-admin]
secrets:
  ldap-admin:
    file: ./ldap-admin.txt
docker exec openldap ldapsearch -Q -Y EXTERNAL -H ldapi:/// -b cn=config dn    # cn=config as root, no password

On a volume initialised by bitnami/openldap itself, cn=config grants ldapi access to uid 1001 only (bitnami's ACL, kept as is): use docker exec -u 1001 ... there.

⁠Notes

  • A data directory moves between lines with slapcat / slapadd, not by mounting it into a newer slapd (2.4 bdb / hdb databases do not open in 2.5+ at all).
  • 2.4 is end-of-life upstream; it is here for data that has to be read or migrated.
  • Licences: OpenLDAP is under the OpenLDAP Public License, Cyrus SASL under a BSD-style licence; the image recipe is MIT.

Folders are written by bin/python/openldap-versions-sync.py.

Tag summary
Recent tags
Content type
Image
Digest
sha256:ee6d19ab0…
Size
708.6 MB
Last updated
about 5 hours ago
docker pull epicmorg/openldap:latest