docker-openldap-backup
A docker image to run OpenLDAP, and make periodic backups 🐳
docker-openldap-backup: OpenLDAP with a backup habit
A Docker image that runs OpenLDAP and schedules periodic backups of its configuration and data. Backups land in a mapped volume so the LDAP files survive outside the container.
Run, and it backs itself up
The image runs OpenLDAP and, on top of that, makes periodic backups. Backups are written to /data/backup, which should be mapped as a volume so the LDAP files end up outside the container. The run example in the README passes a cron expression and a backup volume in one docker run command, detached.
Two schedules, one default
Backup timing lives in environment variables. LDAP_BACKUP_CONFIG_CRON_EXP holds the cron expression for the configuration backup, and LDAP_BACKUP_DATA_CRON_EXP does the same for the data backup. Both default to 0 4, meaning every day at 4am. Either one can be overridden by passing a new value when the container starts.
Setting environment variables
Environment can be supplied two ways. The command line takes the --env flag for a quick override, and a YAML environment file offers a more structured route. The README warns that custom files should be linked into the numbered subdirectories of the environment folder so they are processed before the defaults, because the base directory holds predefined files that fix things like LANG and locale settings.
Around the container
The image builds on osixia/openldap, with a link to that upstream project for more detail. Log levels run from none, error, warning, info, debug, and trace, with info as the default. Security findings go to a project email address, minor issues can be filed on GitHub, and a note on Kubernetes describes it as a system for managing containerized applications. Contributions come in as pull requests, plus helping users and starring the repo.
Editorial conclusion
Two cron variables drive the schedule, both defaulting to every day at 4am. Point a volume at the backup directory, override the timings if you like, and the container handles the rest.
Community notes