Skip to content

Commit

Permalink
Switch from openjdk to eclipse-temurin for base images. (4.3) (#213)
Browse files Browse the repository at this point in the history
* Switch from 'openjdk' to 'eclipse-temurin' for base images.

The 'openjdk' images are being retired/discontinued.  Since Eclipse Temurin was previously
selected for other Graylog uses, it is a natural replacement for the official Graylog images.

Ubuntu Jammy, selected as the OS variant here (and by the Temurin project for non-specific tags),
will have standard support until April 2027.

Refs:
* docker-library/openjdk#505
* Graylog2/graylog2-server#11467
* https://github.com/Graylog2/graylog2-server/blob/bf001c5a039380e0afadc9f570d070d2b70ee578/.github/workflows/build.yml#L18

* Fix loading of SO for non-root users.

This is something that was being done in the 'openjdk' images, but isn't (currently) with Temurin.  Without this the following error will occur: 'java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory'.

Refs:
* https://github.com/docker-library/openjdk/blob/da594d91b0364d5f1a32e0ce6b4d3fd8a9116844/8/jdk/slim-bullseye/Dockerfile#L105
* docker-library/openjdk#331 (comment)

* Mention that prior Graylog images were based on 'openjdk' images.

* July Graylog images have already been released, so assume August.
  • Loading branch information
supahgreg authored Jul 26, 2022
1 parent 723d0ef commit a45a792
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@ updates:
interval: daily
time: "11:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: openjdk
versions:
- ">= 11.pre.jre.pre.slim.a"
- "< 12"
4 changes: 3 additions & 1 deletion README.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ Graylog is a centralized logging solution that enables aggregating and searching

## Image Details

There are several different image variants available, with variants for Java 8 and 11 on platforms `linux/amd64` and `linux/arm64`. All images run on Debian 11.
There are several different image variants available, with variants for Java 8 and 11 on platforms `linux/amd64` and `linux/arm64`. All images are based on the latest [Eclipse Temurin image](https://hub.docker.com/_/eclipse-temurin) (JRE + Ubuntu LTS variant) available at build time.

> Note: Images released prior to August 2022 were based on variants of the now-deprecated [`openjdk` image](https://hub.docker.com/_/openjdk).

#### `graylog/graylog`

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ Graylog is a centralized logging solution that enables aggregating and searching

## Image Details

There are several different image variants available, with variants for Java 8 and 11 on platforms `linux/amd64` and `linux/arm64`. All images run on Debian 11.
There are several different image variants available, with variants for Java 8 and 11 on platforms `linux/amd64` and `linux/arm64`. All images are based on the latest [Eclipse Temurin image](https://hub.docker.com/_/eclipse-temurin) (JRE + Ubuntu LTS variant) available at build time.

> Note: Images released prior to August 2022 were based on variants of the now-deprecated [`openjdk` image](https://hub.docker.com/_/openjdk).
#### `graylog/graylog`

Expand Down Expand Up @@ -91,4 +93,4 @@ Documentation for Graylog is hosted [here](https://docs.graylog.org/). Please re

Graylog itself is licensed under the Server Side Public License (SSPL), see [license information](https://www.mongodb.com/licensing/server-side-public-license).

This Docker image is licensed under the Apache 2.0 license, see [LICENSE](LICENSE).
This Docker image is licensed under the Apache 2.0 license, see [LICENSE](LICENSE).
10 changes: 6 additions & 4 deletions docker/enterprise/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG JAVA_VERSION_MAJOR=8

# layer for download and verifying
FROM debian:bullseye-slim as graylog-downloader
FROM ubuntu:jammy as graylog-downloader

ARG VCS_REF
ARG BUILD_DATE
Expand Down Expand Up @@ -74,8 +74,7 @@ COPY config ${GRAYLOG_HOME}/data/config
# -------------------------------------------------------------------------------------------------
#
# final layer
# use the smallest debian with headless openjdk and copying files from download layers
FROM openjdk:${JAVA_VERSION_MAJOR}-jre-slim-bullseye
FROM eclipse-temurin:${JAVA_VERSION_MAJOR}-jre-jammy

ARG VCS_REF
ARG GRAYLOG_VERSION
Expand All @@ -93,7 +92,6 @@ WORKDIR ${GRAYLOG_HOME}

# hadolint ignore=DL3027,DL3008
RUN \
echo "export JAVA_HOME=/usr/local/openjdk-${JAVA_VERSION_MAJOR}" > /etc/profile.d/graylog.sh && \
echo "export BUILD_DATE=${BUILD_DATE}" >> /etc/profile.d/graylog.sh && \
echo "export GRAYLOG_VERSION=${GRAYLOG_VERSION}" >> /etc/profile.d/graylog.sh && \
echo "export GRAYLOG_SERVER_JAVA_OPTS='-Dlog4j2.formatMsgNoLookups=true -Djdk.tls.acknowledgeCloseNotify=true -XX:+UnlockExperimentalVMOptions -XX:NewRatio=1 -XX:MaxMetaspaceSize=256m -server -XX:+ResizeTLAB -XX:-OmitStackTraceInFastThrow'" >> /etc/profile.d/graylog.sh && \
Expand Down Expand Up @@ -128,6 +126,10 @@ RUN \
--quiet \
"${GRAYLOG_USER}" && \
setcap 'cap_net_bind_service=+ep' "${JAVA_HOME}/bin/java" && \
# https://github.com/docker-library/openjdk/blob/da594d91b0364d5f1a32e0ce6b4d3fd8a9116844/8/jdk/slim-bullseye/Dockerfile#L105
# https://github.com/docker-library/openjdk/issues/331#issuecomment-498834472
find "$JAVA_HOME/lib" -name '*.so' -exec dirname '{}' ';' | sort -u > /etc/ld.so.conf.d/docker-openjdk.conf && \
ldconfig && \
apt-get remove --assume-yes --purge \
apt-utils > /dev/null && \
rm -f /etc/apt/sources.list.d/* && \
Expand Down
2 changes: 1 addition & 1 deletion docker/forwarder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:8-jre-slim-bullseye
FROM eclipse-temurin:8-jre-jammy

ARG VCS_REF
ARG BUILD_DATE
Expand Down
10 changes: 6 additions & 4 deletions docker/oss/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG JAVA_VERSION_MAJOR=8

# layer for download and verifying
FROM debian:bullseye-slim as graylog-downloader
FROM ubuntu:jammy as graylog-downloader

ARG VCS_REF
ARG GRAYLOG_VERSION
Expand Down Expand Up @@ -49,8 +49,7 @@ COPY config ${GRAYLOG_HOME}/data/config
# -------------------------------------------------------------------------------------------------
#
# final layer
# use the smallest debian with headless openjdk and copying files from download layers
FROM openjdk:${JAVA_VERSION_MAJOR}-jre-slim-bullseye
FROM eclipse-temurin:${JAVA_VERSION_MAJOR}-jre-jammy

ARG VCS_REF
ARG GRAYLOG_VERSION
Expand All @@ -68,7 +67,6 @@ WORKDIR ${GRAYLOG_HOME}

# hadolint ignore=DL3027,DL3008
RUN \
echo "export JAVA_HOME=/usr/local/openjdk-${JAVA_VERSION_MAJOR}" > /etc/profile.d/graylog.sh && \
echo "export BUILD_DATE=${BUILD_DATE}" >> /etc/profile.d/graylog.sh && \
echo "export GRAYLOG_VERSION=${GRAYLOG_VERSION}" >> /etc/profile.d/graylog.sh && \
echo "export GRAYLOG_SERVER_JAVA_OPTS='-Dlog4j2.formatMsgNoLookups=true -Djdk.tls.acknowledgeCloseNotify=true -XX:+UnlockExperimentalVMOptions -XX:NewRatio=1 -XX:MaxMetaspaceSize=256m -server -XX:+ResizeTLAB -XX:-OmitStackTraceInFastThrow'" >> /etc/profile.d/graylog.sh && \
Expand Down Expand Up @@ -103,6 +101,10 @@ RUN \
--quiet \
"${GRAYLOG_USER}" && \
setcap 'cap_net_bind_service=+ep' "${JAVA_HOME}/bin/java" && \
# https://github.com/docker-library/openjdk/blob/da594d91b0364d5f1a32e0ce6b4d3fd8a9116844/8/jdk/slim-bullseye/Dockerfile#L105
# https://github.com/docker-library/openjdk/issues/331#issuecomment-498834472
find "$JAVA_HOME/lib" -name '*.so' -exec dirname '{}' ';' | sort -u > /etc/ld.so.conf.d/docker-openjdk.conf && \
ldconfig && \
apt-get remove --assume-yes --purge \
apt-utils > /dev/null && \
rm -f /etc/apt/sources.list.d/* && \
Expand Down

0 comments on commit a45a792

Please sign in to comment.