-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.fedora
73 lines (51 loc) · 2.36 KB
/
Dockerfile.fedora
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
63
64
65
66
67
68
69
70
71
72
73
FROM fedora:36 as builder
ARG BUILD_VERSION
RUN dnf upgrade -y
RUN dnf install -y gcc g++ binutils wget libtool \
autoconf automake make rsync cracklib-devel pam-devel \
libevent-devel openldap openldap-devel nspr-devel nss-devel libdb-devel \
libicu-devel nss-util-devel net-snmp-devel krb5-devel pcre-devel \
python3 python3-devel nss-tools rust cargo lmdb-devel json-c-devel \
openssl openssl-devel
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 pip install python-ldap
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 && make lib389 && make install && make lib389-install
#WORKDIR /data
#VOLUME /data
#EXPOSE 3389 3636
#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
# CMD [ "/usr/libexec/dirsrv/dscontainer", "-r" ]
# CMD [ "/bin/bash" ]
FROM fedora:36 as production
RUN dnf upgrade -y
RUN dnf install -y binutils cracklib pam libevent openldap nspr nss libdb \
libicu nss-util net-snmp krb5-libs pcre python3 python3-lib389 nss-tools \
lmdb json-c openssl && dnf clean all
COPY --from=builder /opt /opt
COPY --from=builder /usr/sbin/ds* /usr/sbin/
COPY --from=builder /usr/local/lib/python3.10 /usr/local/lib/python3.10
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" ]