mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

vharseko
16.28.2019 9dd4e93018580a870b18736cc9d0f4372933ca10
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
FROM java:8
 
MAINTAINER Open Identity Platform Community <open-identity-platform-opendj@googlegroups.com>
 
ARG ADD_BASE_ENTRY="--addBaseEntry"
 
ARG PORT=1389
 
ARG LDAPS_PORT=1636
 
ARG BASE_DN="dc=example,dc=com"
 
ARG ROOT_USER_DN="cn=Directory Manager"
 
ARG ROOT_PASSWORD=password
 
ARG VERSION=@project_version@
 
ARG OPENDJ_USER="opendj"
 
WORKDIR /opt
 
RUN apt-get install -y wget unzip
 
RUN wget --quiet \
  https://github.com/OpenIdentityPlatform/OpenDJ/releases/download/$VERSION/opendj-$VERSION.zip && \
  unzip opendj-$VERSION.zip && \
  rm -r opendj-$VERSION.zip
 
RUN useradd -m -r -u 1001 -g root $OPENDJ_USER
 
RUN chgrp -R 0 /opt/opendj && \
  chmod -R g=u /opt/opendj
 
USER $OPENDJ_USER
 
RUN /opt/opendj/setup --cli -p $PORT --ldapsPort $LDAPS_PORT --enableStartTLS \
  --generateSelfSignedCertificate --baseDN "$BASE_DN" -h localhost --rootUserDN "$ROOT_USER_DN" \
  --rootUserPassword "$ROOT_PASSWORD" --acceptLicense --no-prompt --doNotStart $ADD_BASE_ENTRY
 
EXPOSE $PORT $LDAPS_PORT 4444
 
CMD ["/opt/opendj/bin/start-ds", "--nodetach"