Dockerfile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Use osixia/light-baseimage
  2. # sources: https://github.com/osixia/docker-light-baseimage
  3. FROM osixia/light-baseimage:1.1.2
  4. ARG LDAP_OPENLDAP_GID
  5. ARG LDAP_OPENLDAP_UID
  6. ARG PQCHECKER_VERSION=2.0.0
  7. ARG PQCHECKER_MD5=c005ce596e97d13e39485e711dcbc7e1
  8. # Add openldap user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
  9. # If explicit uid or gid is given, use it.
  10. RUN if [ -z "${LDAP_OPENLDAP_GID}" ]; then groupadd -r openldap; else groupadd -r -g ${LDAP_OPENLDAP_GID} openldap; fi \
  11. && if [ -z "${LDAP_OPENLDAP_UID}" ]; then useradd -r -g openldap openldap; else useradd -r -g openldap -u ${LDAP_OPENLDAP_UID} openldap; fi
  12. # Add stretch-backports in preparation for downloading newer openldap components, especially sladp
  13. RUN echo "deb http://ftp.debian.org/debian stretch-backports main" >> /etc/apt/sources.list
  14. # Install OpenLDAP, ldap-utils and ssl-tools from the (backported) baseimage and clean apt-get files
  15. # sources: https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/add-service-available
  16. #  https://github.com/osixia/docker-light-baseimage/blob/stable/image/service-available/:ssl-tools/download.sh
  17. RUN echo "path-include /usr/share/doc/krb5*" >> /etc/dpkg/dpkg.cfg.d/docker && apt-get -y update \
  18. && /container/tool/add-service-available :ssl-tools \
  19. && LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get -t stretch-backports install -y --no-install-recommends \
  20. ca-certificates \
  21. curl \
  22. ldap-utils \
  23. libsasl2-modules \
  24. libsasl2-modules-db \
  25. libsasl2-modules-gssapi-mit \
  26. libsasl2-modules-ldap \
  27. libsasl2-modules-otp \
  28. libsasl2-modules-sql \
  29. openssl \
  30. slapd \
  31. krb5-kdc-ldap \
  32. && curl -o pqchecker.deb -SL http://www.meddeb.net/pub/pqchecker/deb/8/pqchecker_${PQCHECKER_VERSION}_amd64.deb \
  33. && echo "${PQCHECKER_MD5} *pqchecker.deb" | md5sum -c - \
  34. && dpkg -i pqchecker.deb \
  35. && rm pqchecker.deb \
  36. && apt-get remove -y --purge --auto-remove curl ca-certificates \
  37. && apt-get clean \
  38. && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  39. # Add service directory to /container/service
  40. ADD service /container/service
  41. # Use baseimage install-service script
  42. # https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/install-service
  43. RUN /container/tool/install-service
  44. # Add default env variables
  45. ADD environment /container/environment/99-default
  46. # Expose default ldap and ldaps ports
  47. EXPOSE 389 636
  48. # Put ldap config and database dir in a volume to persist data.
  49. # VOLUME /etc/ldap/slapd.d /var/lib/ldap