Dockerfile 1.4 KB

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