-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.debian
62 lines (44 loc) · 2.45 KB
/
Dockerfile.debian
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
58
59
60
61
62
FROM debian:stable-slim as builder
ARG BUILD_VERSION
RUN apt update -y && apt upgrade -y && apt install -y tzdata
RUN apt install -y pkg-config build-essential wget libtool autoconf automake \
openssl libnspr4 libnspr4-dev libdb5.3++ libdb5.3++-dev libnss3 \
libnss3-dev libcrack2 libcrack2-dev libsnmp-base libsnmp-dev libkrb5-dev \
python3 python3-dev python3-pip git libpam0g libpam0g-dev libldap-common \
libldap2-dev libsasl2-dev libldap2-dev libssl-dev libtool libtool-bin make \
rsync libnss3 libnss3-dev libevent-2.1-7 libevent-core-2.1-7 libevent-dev \
libicu-dev libpcre2-dev libnss3-tools rustc cargo liblmdb-dev libjson-c-dev
RUN pip install setuptools && pip install argcomplete && pip install python-ldap && pip install 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 ./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 -j 8 lib389 && make install && make lib389-install
WORKDIR /
RUN rm -fr /build
FROM debian:stable-slim as production
RUN apt update -y && apt upgrade -y && apt install -y tzdata
RUN apt install -y pkg-config openssl libnspr4 libdb5.3++ libnss3 libcrack2 libsnmp-base libkrb5-3 \
python3 python3-pip libpam0g libldap-common libsasl2-2 libldap-2.4-2 libssl1.1 \
libevent-2.1-7 libevent-core-2.1-7 libpcre2-8-0 libnss3-tools liblmdb0 libjson-c5
COPY --from=builder /opt /opt
COPY --from=builder /usr/sbin/ds* /usr/sbin
COPY --from=builder /usr/local/lib/python3.8 /usr/local/lib/python3.8
COPY --from=builder /usr/lib/python* /usr/lib
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" ]