-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.alpine
57 lines (40 loc) · 2.04 KB
/
Dockerfile.alpine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM --platform=$BUILDPLATFORM alpine:3 as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "*** BUILDPLATFORM=$BUILDPLATFORM TARGETPLATFORM=$TARGETPLATFORM"
ARG BUILD_VERSION
RUN apk add build-base wget libtool autoconf automake openssl-dev cracklib-dev \
libevent-dev nspr-dev nss-dev openldap-dev db-dev icu-dev \
net-snmp-dev krb5-dev pcre-dev make rsync nss-tools openssl \
linux-pam-dev python3 py3-pip python3-dev git
RUN if [ "$TARGETPLATFORM" != "linux/arm/v7" ]; then apk add rust cargo ; fi
RUN pip install setuptools argcomplete python-ldap python-dateutil
RUN mkdir /build
WORKDIR /build
RUN wget "https://github.com/389ds/389-ds-base/archive/refs/tags/389-ds-base-$BUILD_VERSION.tar.gz"
RUN tar xvfz "389-ds-base-$BUILD_VERSION.tar.gz"
WORKDIR "/build/389-ds-base-389-ds-base-$BUILD_VERSION"
RUN ./autogen.sh
RUN if [ "$TARGETPLATFORM" != "linux/arm/v7" ]; then ./configure --with-openldap --enable-rust ; fi
RUN if [ "$TARGETPLATFORM" == "linux/arm/v7" ]; then ./configure --with-openldap; fi
RUN sed -e 's/.*build_manpages.*/\tcd \$\(srcdir\)\/src\/lib389\; \$\(PYTHON\) setup.py build/g' Makefile > M
RUN mv M Makefile
COPY setup.py src/lib389/setup.py
RUN make -j 8 && make lib389 -j 8 && make install && make lib389-install
FROM alpine:3
RUN apk add openssl cracklib libevent nspr nss openldap db icu \
net-snmp krb5 pcre nss-tools openssl linux-pam python3
COPY --from=builder /opt /opt
COPY --from=builder /usr/sbin/ds* /usr/sbin/
COPY --from=builder /usr/lib/python3.9 /usr/lib/python3.9
COPY --from=builder /usr/libexec/dirsrv /usr/libexec/dirsrv
RUN mkdir -p /data /data/config /data/run /opt/dirsrv/var/run/dirsrv; \
ln -s /data/run /opt/dirsrv/var/run/dirsrv; \
ln -s /data/ssca /opt/dirsrv/etc/dirsrv/ssca; \
ln -s /data/config /opt/dirsrv/etc/dirsrv/slapd-localhost
HEALTHCHECK --start-period=5m --timeout=5s --interval=5s --retries=2 \
CMD /usr/libexec/dirsrv/dscontainer -H
WORKDIR /data
VOLUME /data
EXPOSE 3389 3636
CMD [ "/usr/libexec/dirsrv/dscontainer", "-r" ]