| | |
| | | # The headless JRE: the server and the command-line tools do not draw, and the full JRE only |
| | | # adds what AWT needs to - X11, ALSA, freetype with brotli, the image codecs - along with their |
| | | # CVEs. The GUI tools (control-panel) are run outside the container, against its admin port. |
| | | RUN apk add --update --no-cache --virtual builddeps curl unzip \ |
| | | && apk upgrade --update --no-cache \ |
| | | # Keep the repository indexes for this layer so add and upgrade can reuse them. |
| | | RUN apk_retry() { \ |
| | | for delay in 5 15; do \ |
| | | if apk "$@"; then return 0; fi; \ |
| | | echo "apk $* failed, retrying in ${delay}s" >&2; \ |
| | | sleep "$delay" || return; \ |
| | | done; \ |
| | | apk "$@"; \ |
| | | } \ |
| | | && apk_retry update \ |
| | | && apk_retry add --virtual builddeps curl unzip \ |
| | | && apk_retry upgrade \ |
| | | && if [ "$TARGETARCH" = "386" ]; then JDK=openjdk11-jre-headless; else JDK=openjdk25-jre-headless; fi \ |
| | | && apk add bash coreutils "$JDK" \ |
| | | && apk_retry add bash coreutils "$JDK" \ |
| | | && if [ -z "$VERSION" ] ; then VERSION="$(curl -i -o - --silent https://api.github.com/repos/OpenIdentityPlatform/OpenDJ/releases/latest | grep -m1 "\"name\"" | cut -d\" -f4)"; fi \ |
| | | && if [ ! -f "$OPENDJ_DIST_FILENAME" ]; then echo file exists && curl -L https://github.com/OpenIdentityPlatform/OpenDJ/releases/download/$VERSION/opendj-$VERSION.zip --output $OPENDJ_DIST_FILENAME; fi \ |
| | | && unzip $OPENDJ_DIST_FILENAME \ |
| | | && apk del builddeps \ |
| | | && apk del curl \ |
| | | && apk del unzip \ |
| | | && rm -f /var/cache/apk/* \ |
| | | && rm -r $OPENDJ_DIST_FILENAME \ |
| | | && addgroup -S $OPENDJ_USER \ |
| | | && adduser -S -u 1001 -G $OPENDJ_USER $OPENDJ_USER \ |