Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion opendj-packages/opendj-docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ ENV LDAPS_PORT=1636
ENV ADMIN_PORT=4444
ENV BASE_DN="dc=example,dc=com"
ENV ROOT_USER_DN="cn=Directory Manager"
ENV ROOT_PASSWORD="password"
# ROOT_PASSWORD should be passed at runtime via: docker run -e ROOT_PASSWORD=...
# or mount a Docker secret file to /run/secrets/root_password
# Default value if not provided: "password"
#ENV SECRET_VOLUME
ENV OPENDJ_SSL_OPTIONS="--generateSelfSignedCertificate"
#ENV MASTER_SERVER
Expand Down
4 changes: 3 additions & 1 deletion opendj-packages/opendj-docker/Dockerfile-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ ENV LDAPS_PORT=1636
ENV ADMIN_PORT=4444
ENV BASE_DN="dc=example,dc=com"
ENV ROOT_USER_DN="cn=Directory Manager"
ENV ROOT_PASSWORD="password"
# ROOT_PASSWORD should be passed at runtime via: docker run -e ROOT_PASSWORD=...
# or mount a Docker secret file to /run/secrets/root_password
# Default value if not provided: "password"
#ENV SECRET_VOLUME
ENV OPENDJ_SSL_OPTIONS="--generateSelfSignedCertificate"
#ENV MASTER_SERVER
Expand Down
9 changes: 7 additions & 2 deletions opendj-packages/opendj-docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ echo "Instance data Directory is empty. Creating new DJ instance"
export BASE_DN=${BASE_DN:-"dc=example,dc=com"}
echo "BASE DN is ${BASE_DN}"

export PASSWORD=${ROOT_PASSWORD:-password}
echo "Password set to $PASSWORD"
# Read ROOT_PASSWORD from Docker secret file if available, fall back to env var, then default
if [ -f /run/secrets/root_password ]; then
export ROOT_PASSWORD=$(tr -d '\n\r' < /run/secrets/root_password)
fi
export ROOT_PASSWORD=${ROOT_PASSWORD:-password}
export PASSWORD=${ROOT_PASSWORD}
echo "Password is set"

BOOTSTRAP=${BOOTSTRAP:-/opt/opendj/bootstrap/setup.sh}
echo "Running $BOOTSTRAP"
Expand Down
Loading