diff --git a/Dockerfile b/Dockerfile index 52929a9..906299b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG docker_parent_image=ghcr.io/openzipkin/alpine:3.18.5 # When updating, also update the README # * Use current version from https://pkgs.alpinelinux.org/packages?name=openjdk21, stripping # the `-rX` at the end. -ARG java_version=21.0.1_p12 +ARG java_version=17.0.9_p8 ARG java_home=/usr/lib/jvm/java-21-openjdk # We copy files from the context into a scratch container first to avoid a problem where docker and @@ -66,7 +66,11 @@ FROM jdk as install WORKDIR /install # Included modules cherry-picked from https://docs.oracle.com/en/java/javase/21/docs/api/ -RUN jlink --vm=server --no-header-files --no-man-pages --compress=0 --strip-debug --add-modules \ +# Note: unlike the master branch, this doesn't use --strip-debug on non-x86_64, because +# it fails like below on JDK17 per #34: +# Error: java.io.IOException: Cannot run program "objcopy": error=0, Failed to exec spawn helper: pid: 39, exit value: 1 +RUN if [ -d "/usr/lib/jvm/java-17-openjdk" ] && uname -m | grep -E 'x86_64'; then strip="--strip-debug"; else strip=""; fi && \ +jlink --vm=server --no-header-files --no-man-pages --compress=0 ${strip} --add-modules \ java.base,java.logging,\ # java.desktop includes java.beans which is used by Spring java.desktop,\ diff --git a/README.md b/README.md index 072cf64..a9690bc 100644 --- a/README.md +++ b/README.md @@ -15,27 +15,27 @@ This is an internal base layer primarily used in [zipkin](https://github.com/ope To try the image, run the `java -version` command: ```bash -docker run --rm ghcr.io/openzipkin/java:21.0.1_p12 -version -openjdk version "21.0.1" 2023-10-17 -OpenJDK Runtime Environment (build 21.0.1+12-alpine-r0) -OpenJDK 64-Bit Server VM (build 21.0.1+12-alpine-r0, mixed mode, sharing) +docker run --rm ghcr.io/openzipkin/java:17.0.9_p8 -version +openjdk version "17.0.9" 2023-10-17 +OpenJDK Runtime Environment (build 17.0.9+8-alpine-r0) +OpenJDK 64-Bit Server VM (build 17.0.9+8-alpine-r0, mixed mode, sharing) ``` ## Release process Build the `Dockerfile` using the current version without the revision classifier from here: * https://pkgs.alpinelinux.org/packages?name=openjdk21 ```bash -# Note 21.0.1_p12 not 21.0.1_p12-r0! -./build-bin/build 21.0.1_p12 +# Note 17.0.9_p8 not 17.0.9_p8-r0! +./build-bin/build 17.0.9_p8 ``` Next, verify the built image matches that version: ```bash docker run --rm openzipkin/java:test -version -openjdk version "21.0.1" 2023-10-17 -OpenJDK Runtime Environment (build 21.0.1+12-alpine-r0) -OpenJDK 64-Bit Server VM (build 21.0.1+12-alpine-r0, mixed mode, sharing) +openjdk version "17.0.9" 2023-10-17 +OpenJDK Runtime Environment (build 17.0.9+8-alpine-r0) +OpenJDK 64-Bit Server VM (build 17.0.9+8-alpine-r0, mixed mode, sharing) ``` -To release the image, push a tag matching the arg to `build-bin/build` (ex `21.0.1_p12`). +To release the image, push a tag matching the arg to `build-bin/build` (ex `17.0.9_p8`). This triggers a [GitHub Actions](https://github.com/openzipkin/docker-java/actions) job to push the image.