Dockerfile 1.0 KB

1234567891011121314151617181920212223242526
  1. FROM buildpack-deps:stretch
  2. ARG LDAP_TAG=2.4.50
  3. RUN apt-get update && apt-get install -y groff groff-base
  4. RUN wget ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-${LDAP_TAG}.tgz \
  5. && gunzip -c openldap-${LDAP_TAG}.tgz | tar xvfB - \
  6. && cd openldap-${LDAP_TAG} \
  7. && ./configure && make depend && make && make install \
  8. && cd .. && rm -rf openldap-${LDAP_TAG}
  9. COPY .ci/docker-compose-file/openldap/slapd.conf /usr/local/etc/openldap/slapd.conf
  10. COPY apps/emqx_authn/test/data/emqx.io.ldif /usr/local/etc/openldap/schema/emqx.io.ldif
  11. COPY apps/emqx_authn/test/data/emqx.schema /usr/local/etc/openldap/schema/emqx.schema
  12. COPY apps/emqx_authn/test/data/certs/*.pem /usr/local/etc/openldap/
  13. RUN mkdir -p /usr/local/etc/openldap/data \
  14. && slapadd -l /usr/local/etc/openldap/schema/emqx.io.ldif -f /usr/local/etc/openldap/slapd.conf
  15. WORKDIR /usr/local/etc/openldap
  16. EXPOSE 389 636
  17. ENTRYPOINT ["/usr/local/libexec/slapd", "-h", "ldap:/// ldaps:///", "-d", "3", "-f", "/usr/local/etc/openldap/slapd.conf"]
  18. CMD []