Dockerfile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Use osixia/light-baseimage
  2. # sources: https://github.com/osixia/docker-light-baseimage
  3. FROM osixia/light-baseimage:0.2.2
  4. MAINTAINER Bertrand Gouny <[email protected]>
  5. # Add openldap user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
  6. RUN groupadd -r openldap && useradd -r -g openldap openldap
  7. # Install OpenLDAP, ldap-utils and cfssl from baseimage and clean apt-get files
  8. # sources: https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/add-service-available
  9. #  https://github.com/osixia/docker-light-baseimage/blob/stable/image/service-available/:cfssl/download.sh
  10. RUN apt-get -y update \
  11. && /container/tool/add-service-available :cfssl \
  12. && LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes --no-install-recommends \
  13. ldap-utils \
  14. openssl \
  15. slapd \
  16. && apt-get clean \
  17. && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  18. # Add service directory to /container/service
  19. ADD service /container/service
  20. # Use baseimage install-service script
  21. # https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/install-service
  22. RUN /container/tool/install-service
  23. # Add default env variables
  24. ADD environment /container/environment/99-default
  25. # Set OpenLDAP data and config directories in a data volume
  26. VOLUME ["/var/lib/ldap", "/etc/ldap/slapd.d"]
  27. # Expose default ldap and ldaps ports
  28. EXPOSE 389 636