Skip to content
Snippets Groups Projects
Select Git revision
  • b3097d22de723cefb6df96cdd55b6d840d1e6086
  • master default protected
2 results

Dockerfile

Blame
  • Dockerfile 1.42 KiB
    FROM debian:buster-slim AS builder
    MAINTAINER Andrej Ramašeuski <andrej.ramaseuski@pirati.cz>
    
    ARG BUILD_ENV
    ENV BUILD_ENV=${BUILD_ENV:-"prod"}
    
    ENV PREFIX=/opt
    ENV OPENLDAP_INSTALL_DIR=${PREFIX}/ldap
    ENV OPENLDAP_VERSION=2.4.48
    
    # Temporary install deps
    RUN apt-get update
    RUN apt-get install -y wget build-essential git libtool libdb-dev groff groff-base
    
    # Build tmp OpenLDAP
    RUN mkdir -p ${PREFIX}
    WORKDIR ${PREFIX}
    RUN wget ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-${OPENLDAP_VERSION}.tgz
    RUN tar xzf openldap-${OPENLDAP_VERSION}.tgz
    RUN mv openldap-${OPENLDAP_VERSION} ldap
    WORKDIR ${OPENLDAP_INSTALL_DIR}
    RUN ./configure --prefix=${PREFIX} --enable-modules
    RUN make depend
    RUN make
    RUN make install
    
    # Build bcrypt OpenLDAP
    RUN mkdir -p ${OPENLDAP_INSTALL_DIR}/contrib/slapd-modules/passwd
    WORKDIR ${OPENLDAP_INSTALL_DIR}/contrib/slapd-modules/passwd
    RUN git clone https://github.com/wclarie/openldap-bcrypt.git bcrypt
    WORKDIR ${OPENLDAP_INSTALL_DIR}/contrib/slapd-modules/passwd/bcrypt
    RUN make
    RUN make install
    
    FROM osixia/openldap-backup:1.4.0
    MAINTAINER Andrej Ramašeuski <andrej.ramaseuski@pirati.cz>
    
    # Osixia/OpenLDAP extension
    COPY --from=builder /usr/local/libexec/openldap/pw-bcrypt.so /usr/lib/ldap/pw-bcrypt.so
    ADD bootstrap /container/service/slapd/assets/config/bootstrap
    ADD environment /container/environment/01-custom
    RUN mkdir /var/log/slapd && \
        chown openldap.openldap /var/log/slapd
    
    WORKDIR /