-
-
Save ictus4u/87b62ed6f7e6cef72c421b40a579594e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM base/archlinux | |
RUN echo "installing openldap" \ | |
&& sed 's/^CheckSpace/# CheckSpace/g' -i /etc/pacman.conf \ | |
&& pacman -Syyu --noconfirm \ | |
&& sed 's/^# CheckSpace/CheckSpace/g' -i /etc/pacman.conf \ | |
&& pacman -S --noconfirm openldap | |
RUN echo "configuring openldap" \ | |
&& sed -i 's/^suffix.*/suffix\t"dc=example,dc=org"/' /etc/openldap/slapd.conf \ | |
&& sed -i 's/^rootdn.*/rootdn\t"cn=root,dc=example,dc=org"/' /etc/openldap/slapd.conf \ | |
&& sed -i 's/^rootpw.*/rootpw\tsecret/' /etc/openldap/slapd.conf \ | |
&& echo "index cn eq" >> /etc/openldap/slapd.conf \ | |
&& echo "index dc eq" >> /etc/openldap/slapd.conf \ | |
&& mkdir /run/openldap/ \ | |
&& chown ldap:ldap /run/openldap/ \ | |
&& cp /etc/openldap/DB_CONFIG.example /var/lib/openldap/openldap-data/DB_CONFIG \ | |
&& chown ldap:ldap /var/lib/openldap/openldap-data/DB_CONFIG \ | |
&& sed -i 's/^set_cachesize.*/set_cachesize 0 10485760 1/' /var/lib/openldap/openldap-data/DB_CONFIG \ | |
&& sed -i '/^database/ a cachesize\t100' /etc/openldap/slapd.conf \ | |
&& (slapd & (sleep 1 && pkill slapd)) \ | |
&& slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d/ \ | |
&& chown -R ldap:ldap /etc/openldap/slapd.d/ | |
EXPOSE 389 | |
CMD ["/usr/bin/slapd", "-d", "1"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh -- | |
set -e | |
echo "installing openldap" | |
sed 's/^CheckSpace/# CheckSpace/g' -i /etc/pacman.conf | |
pacman -Syyu --noconfirm | |
sed 's/^# CheckSpace/CheckSpace/g' -i /etc/pacman.conf | |
pacman -S --noconfirm openldap | |
echo "configuring openldap" | |
sed -i 's/^suffix.*/suffix\t"dc=example,dc=org"/' /etc/openldap/slapd.conf | |
sed -i 's/^rootdn.*/rootdn\t"cn=root,dc=example,dc=org"/' /etc/openldap/slapd.conf | |
sed -i 's/^rootpw.*/rootpw\tsecret/' /etc/openldap/slapd.conf | |
echo "index cn eq" >> /etc/openldap/slapd.conf | |
echo "index dc eq" >> /etc/openldap/slapd.conf | |
mkdir /run/openldap/ | |
chown ldap:ldap /run/openldap/ | |
cp /etc/openldap/DB_CONFIG.example /var/lib/openldap/openldap-data/DB_CONFIG | |
chown ldap:ldap /var/lib/openldap/openldap-data/DB_CONFIG | |
sed -i 's/^set_cachesize.*/set_cachesize 0 10485760 1/' /var/lib/openldap/openldap-data/DB_CONFIG | |
sed -i '/^database/ a cachesize\t100' /etc/openldap/slapd.conf | |
(slapd & (sleep 1 && pkill slapd)) | |
slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d/ | |
chown -R ldap:ldap /etc/openldap/slapd.d/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment