2016-04-05 02:34:46 +02:00
|
|
|
# Run slapd in a docker container
|
|
|
|
#
|
|
|
|
# - `LDAP_DOMAIN` sets the LDAP root domain. (e.g. if you provide `foo.bar.com`
|
|
|
|
# here, the root of your directory will be `dc=foo,dc=bar,dc=com`)
|
|
|
|
# - `LDAP_ORGANIZATION` sets the human-readable name for your organization (e.g.
|
|
|
|
# `Acme Widgets Inc.`)
|
|
|
|
# - `LDAP_ROOTPASS` sets the LDAP admin user password (i.e. the password for
|
|
|
|
# `cn=admin,dc=example,dc=com` if your domain was `example.com`)
|
|
|
|
#
|
|
|
|
# How to start the container:
|
|
|
|
#
|
|
|
|
# docker run -v /data/ldap:/var/lib/ldap \
|
|
|
|
# -e LDAP_DOMAIN=authy.auth.co \
|
|
|
|
# -e LDAP_ORGANISATION="E Corp" \
|
|
|
|
# -e LDAP_ROOTPASS=fsociety \
|
|
|
|
# -d jess/slapd
|
|
|
|
#
|
|
|
|
# You can load an LDIF file (to set up your directory) like so:
|
|
|
|
#
|
2016-04-05 02:54:07 +02:00
|
|
|
# docker exec -it your_container ldapadd \
|
|
|
|
# -h localhost -p <host_port_of_container> -c -x \
|
2016-04-05 02:34:46 +02:00
|
|
|
# -D cn=admin,dc=mycorp,dc=com -W -f data.ldif
|
|
|
|
#
|
|
|
|
# Be aware that by default the LDAP port is accessible from anywhere if the \
|
|
|
|
# host firewall is unconfigured.
|
|
|
|
#
|
2019-07-26 19:55:34 +02:00
|
|
|
FROM debian:bullseye-slim
|
2017-03-09 19:14:37 +01:00
|
|
|
LABEL maintainer "Jessie Frazelle <jess@linux.com>"
|
2016-04-05 02:34:46 +02:00
|
|
|
|
|
|
|
RUN apt-get update && LC_ALL=C DEBIAN_FRONTEND=noninteractive \
|
|
|
|
apt-get install -y \
|
2016-04-05 02:54:07 +02:00
|
|
|
ldap-utils \
|
2016-04-05 02:34:46 +02:00
|
|
|
slapd \
|
|
|
|
--no-install-recommends \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# Just some default values for fun!
|
|
|
|
ENV LDAP_ROOTPASS=fsociety LDAP_ORGANIZATION="E CORP" LDAP_DOMAIN=mr.robot.com
|
|
|
|
|
|
|
|
COPY start.sh /start.sh
|
|
|
|
|
|
|
|
ENTRYPOINT [ "/start.sh" ]
|