-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
54 lines (36 loc) · 1.82 KB
/
Dockerfile
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
FROM alpine:3.16.2 as builder
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 rust cargo lmdb-dev json-c-dev
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 && ./configure --with-openldap --enable-rust
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.16.2
RUN apk add openssl cracklib libevent nspr nss openldap db icu \
net-snmp krb5 pcre nss-tools openssl linux-pam lmdb json-c 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
COPY systemd-detect-virt /usr/bin
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 && \
chmod 0755 /usr/bin/systemd-detect-virt
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" ]