Docker Notes
Prerequisites
Install docker and debootstrap
Create base image
~> cd / /> mkdir /symas /> debootstrap stable /symas/ http://deb.debian.org/debian
Import base image
/> tar -C /symas -c . | docker import - symas/debian-jessie
Copy Symas installer to docker build dir
/> cd ~/DockerBuildDir DockerBuildDir> cp <installer .deb> .
Add/modify Dockerfile
DockerBuildDir> vi Dockerfile
# Dockerfile for Symas OpenLDAP
FROM debian:jessie
LABEL vendor="Symas Corporation" \
symas.openldap.version="2.4.44.5" \
symas.openldap.edition="Gold" \
symas.openldap.arch="amd64"
# Install Symas OpenLDAP
COPY symas-openldap-gold.64_2.4.44-5_amd64.deb /
RUN dpkg -i symas-openldap-gold.64_2.4.44-5_amd64.deb \
&& rm -f symas-openldap-gold.64_2.4.44-5_amd64.deb
# Add your configuration
COPY symas-openldap.conf /opt/symas/etc/openldap
# If using slapd.conf
COPY slapd.conf /opt/symas/etc/openldap
# If using cn=config...
#COPY my_cn-config.ldif /tmp
#RUN mkdir /opt/symas/etc/openldap/slapd.d && \
# /opt/symas/bin/slapadd -l /tmp/my_cn-config.ldif -F /opt/symas/etc/openldap/slapd.d -q && \
# rm /tmp/my_cn-config.ldif
# This creates the data directory in the container
VOLUME /var/symas/openldap-data
# The ports to make available
EXPOSE 389 636
# This starts slapd when the container starts. The "-d 0" is required to keep
# the slapd process in the foreground. If slapd were to go to the background,
# docker will assume slapd is done running and will quit.
CMD ["/opt/symas/etc/solserver", "start", "-d 0"]
# That's it
Startup
docker run --rm -d -p 389:389 636:636 --name slapd \
-v /var/symas/openldap-data:/var/symas/openldap-data \
-v /dev/log:/dev/log slapd