From 8eb44dd8bd6f1d6ed412420cfc977502e4e81673 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 7 Feb 2024 07:49:39 +0700 Subject: [PATCH 01/14] deps: alpine 3.19.1 Signed-off-by: Adrian Cole --- Dockerfile | 4 ++-- README.md | 22 +++++++++++----------- install.sh | 7 ++++--- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1e5a0e3..3f62155 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ # docker_parent_image is the base layer of full and jre image # # Use latest version here: https://github.com/orgs/openzipkin/packages/container/package/alpine -ARG docker_parent_image=ghcr.io/openzipkin/alpine:3.19.0 +ARG docker_parent_image=ghcr.io/openzipkin/alpine:3.19.1 # java_version and java_home are hard-coded here to allow the following: # * `docker build https://github.com/openzipkin/docker-java.git` @@ -17,7 +17,7 @@ ARG docker_parent_image=ghcr.io/openzipkin/alpine:3.19.0 # 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=21.0.2_p13 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 diff --git a/README.md b/README.md index 0542636..927534f 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,10 @@ 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:21.0.2_p13 -version +openjdk version "21.0.2" 2024-01-16 +OpenJDK Runtime Environment (build 21.0.2+13-alpine-r2) +OpenJDK 64-Bit Server VM (build 21.0.2+13-alpine-r2, mixed mode, sharing) ``` ## Release process @@ -39,19 +39,19 @@ Build the [Dockerfile](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 21.0.2_p13 not 21.0.2_p13-r2! +./build-bin/build 21.0.2_p13 ``` 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) +$ docker run --rm openzipkin/java:test -version +openjdk version "21.0.2" 2024-01-16 +OpenJDK Runtime Environment (build 21.0.2+13-alpine-r2) +OpenJDK 64-Bit Server VM (build 21.0.2+13-alpine-r2, 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 `21.0.2_p13`). This triggers a [GitHub Actions](https://github.com/openzipkin/docker-java/actions) job to push the image. ## java.lang.ClassNotFoundException diff --git a/install.sh b/install.sh index 57e1bb6..ebbb6eb 100755 --- a/install.sh +++ b/install.sh @@ -14,7 +14,6 @@ # Install OS packages that support most software we build # * openjdk21-jdk: smaller than openjdk21, which includes docs and demos -# * openjdk21-jmods: needed for module support # * binutils: needed for some node modules and jlink --strip-debug # * tar: BusyBox built-in tar doesn't support --strip=1 # * wget: BusyBox built-in wget doesn't support --tries=3 @@ -32,8 +31,10 @@ maven_version=${2?maven_version is required. ex 3.9.6} java_major_version=$(echo ${java_version}| cut -f1 -d .) package=openjdk${java_major_version} -apk --no-cache add \ -${package}-jmods=~${java_version} ${package}-jdk=~${java_version} binutils tar wget +# Install all packages from the edge community repository, which is where the +# latest openjdk is found. +apk --no-cache add ${package}-jdk=~${java_version} binutils tar wget \ + --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community # Typically, only amd64 is tested in CI: Run commands that ensure binaries match current arch. if ! java -version || ! jar --version || ! jlink --version; then maybe_log_crash; fi From 129a5babb8c12978bc843aca457b7dffed75f522 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 7 Feb 2024 08:37:13 +0700 Subject: [PATCH 02/14] order Signed-off-by: Adrian Cole --- install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index ebbb6eb..650b7f8 100755 --- a/install.sh +++ b/install.sh @@ -31,10 +31,10 @@ maven_version=${2?maven_version is required. ex 3.9.6} java_major_version=$(echo ${java_version}| cut -f1 -d .) package=openjdk${java_major_version} -# Install all packages from the edge community repository, which is where the -# latest openjdk is found. -apk --no-cache add ${package}-jdk=~${java_version} binutils tar wget \ - --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community +# Install openjdk using only the edge repository, to allow latest versions +# without conflicting with what's on +sed -i '1ihttps://dl-cdn.alpinelinux.org/alpine/edge/community' /etc/apk/repositories +apk --no-cache add ${package}-jdk=~${java_version} binutils tar wget # Typically, only amd64 is tested in CI: Run commands that ensure binaries match current arch. if ! java -version || ! jar --version || ! jlink --version; then maybe_log_crash; fi From 942352db2ab2eb1598148b17844f9c225b59f141 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 7 Feb 2024 08:38:53 +0700 Subject: [PATCH 03/14] harder! Signed-off-by: Adrian Cole --- install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 650b7f8..005422a 100755 --- a/install.sh +++ b/install.sh @@ -33,8 +33,10 @@ package=openjdk${java_major_version} # Install openjdk using only the edge repository, to allow latest versions # without conflicting with what's on -sed -i '1ihttps://dl-cdn.alpinelinux.org/alpine/edge/community' /etc/apk/repositories -apk --no-cache add ${package}-jdk=~${java_version} binutils tar wget +echo https://dl-cdn.alpinelinux.org/alpine/edge/community > /tmp/repositories.$$ +apk --no-cache add ${package}-jdk=~${java_version} binutils tar wget \ + --repositories-file /tmp/repositories.$$ +rm /tmp/repositories.$$ # Typically, only amd64 is tested in CI: Run commands that ensure binaries match current arch. if ! java -version || ! jar --version || ! jlink --version; then maybe_log_crash; fi From 353c5db57ebae2b99e1d9b1480a69ba775974b86 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 7 Feb 2024 08:41:46 +0700 Subject: [PATCH 04/14] edge only, but still main Signed-off-by: Adrian Cole --- install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 005422a..c00e3f4 100755 --- a/install.sh +++ b/install.sh @@ -33,7 +33,8 @@ package=openjdk${java_major_version} # Install openjdk using only the edge repository, to allow latest versions # without conflicting with what's on -echo https://dl-cdn.alpinelinux.org/alpine/edge/community > /tmp/repositories.$$ +echo https://dl-cdn.alpinelinux.org/alpine/edge/main >> /tmp/repositories.$$ +echo https://dl-cdn.alpinelinux.org/alpine/edge/community >> /tmp/repositories.$$ apk --no-cache add ${package}-jdk=~${java_version} binutils tar wget \ --repositories-file /tmp/repositories.$$ rm /tmp/repositories.$$ From 29d38f46096746e30fe16ef69803296e66982a1f Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 7 Feb 2024 08:49:00 +0700 Subject: [PATCH 05/14] try update Signed-off-by: Adrian Cole --- install.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index c00e3f4..c4c2c4c 100755 --- a/install.sh +++ b/install.sh @@ -31,13 +31,8 @@ maven_version=${2?maven_version is required. ex 3.9.6} java_major_version=$(echo ${java_version}| cut -f1 -d .) package=openjdk${java_major_version} -# Install openjdk using only the edge repository, to allow latest versions -# without conflicting with what's on -echo https://dl-cdn.alpinelinux.org/alpine/edge/main >> /tmp/repositories.$$ -echo https://dl-cdn.alpinelinux.org/alpine/edge/community >> /tmp/repositories.$$ -apk --no-cache add ${package}-jdk=~${java_version} binutils tar wget \ - --repositories-file /tmp/repositories.$$ -rm /tmp/repositories.$$ +apk update +apk --no-cache add ${package}-jdk=~${java_version} binutils tar wget # Typically, only amd64 is tested in CI: Run commands that ensure binaries match current arch. if ! java -version || ! jar --version || ! jlink --version; then maybe_log_crash; fi From 4f62d128e86a99c3441f7ecd1e1416f8b8bf5e8e Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 7 Feb 2024 08:51:42 +0700 Subject: [PATCH 06/14] print the world Signed-off-by: Adrian Cole --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index c4c2c4c..47ac9e9 100755 --- a/install.sh +++ b/install.sh @@ -31,7 +31,7 @@ maven_version=${2?maven_version is required. ex 3.9.6} java_major_version=$(echo ${java_version}| cut -f1 -d .) package=openjdk${java_major_version} -apk update +cat /etc/apk/world apk --no-cache add ${package}-jdk=~${java_version} binutils tar wget # Typically, only amd64 is tested in CI: Run commands that ensure binaries match current arch. From fb5538d272a9a04c8f862009a53b2531e72e7a80 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 7 Feb 2024 09:05:40 +0700 Subject: [PATCH 07/14] try del java certs? Signed-off-by: Adrian Cole --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index 47ac9e9..6de0014 100755 --- a/install.sh +++ b/install.sh @@ -32,6 +32,7 @@ java_major_version=$(echo ${java_version}| cut -f1 -d .) package=openjdk${java_major_version} cat /etc/apk/world +apk del java-cacerts apk --no-cache add ${package}-jdk=~${java_version} binutils tar wget # Typically, only amd64 is tested in CI: Run commands that ensure binaries match current arch. From e0a0705a8c6b2c9a00c3c9ec4dc0f6609a1db575 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 7 Feb 2024 09:30:34 +0700 Subject: [PATCH 08/14] maybe busted mirror? Signed-off-by: Adrian Cole --- install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 6de0014..01a5ba7 100755 --- a/install.sh +++ b/install.sh @@ -31,8 +31,7 @@ maven_version=${2?maven_version is required. ex 3.9.6} java_major_version=$(echo ${java_version}| cut -f1 -d .) package=openjdk${java_major_version} -cat /etc/apk/world -apk del java-cacerts +sed -i 's/dl-cdn.alpinelinux.org/uk.alpinelinux.org/g' /etc/apk/repositories apk --no-cache add ${package}-jdk=~${java_version} binutils tar wget # Typically, only amd64 is tested in CI: Run commands that ensure binaries match current arch. From 46700aaa73185180592b2fe4c775f232baaf4c06 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 7 Feb 2024 09:34:45 +0700 Subject: [PATCH 09/14] last try before force world Signed-off-by: Adrian Cole --- install.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 01a5ba7..2505126 100755 --- a/install.sh +++ b/install.sh @@ -31,8 +31,15 @@ maven_version=${2?maven_version is required. ex 3.9.6} java_major_version=$(echo ${java_version}| cut -f1 -d .) package=openjdk${java_major_version} -sed -i 's/dl-cdn.alpinelinux.org/uk.alpinelinux.org/g' /etc/apk/repositories -apk --no-cache add ${package}-jdk=~${java_version} binutils tar wget +# Use only the edge branch, to avoid world conflicts on openjdk, which is +# also on the release (e.g. v3.19) branch, now. The openjdk package will be in +# the community repository, while other utilities are in the main one. +echo https://dl-cdn.alpinelinux.org/alpine/edge/community >> /tmp/repositories.$$ +echo https://dl-cdn.alpinelinux.org/alpine/edge/main >> /tmp/repositories.$$ +apk --no-cache add ${package}-jdk=~${java_version} --repositories-file /tmp/repositories.$$ +rm /tmp/repositories.$$ + +apk --no-cache add binutils tar wget # Typically, only amd64 is tested in CI: Run commands that ensure binaries match current arch. if ! java -version || ! jar --version || ! jlink --version; then maybe_log_crash; fi From e9b714cb2fc1953afbeb9ab0ad8d2dbfde112bce Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 7 Feb 2024 09:39:17 +0700 Subject: [PATCH 10/14] force-broken-world Signed-off-by: Adrian Cole --- install.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/install.sh b/install.sh index 2505126..7b817a6 100755 --- a/install.sh +++ b/install.sh @@ -31,15 +31,11 @@ maven_version=${2?maven_version is required. ex 3.9.6} java_major_version=$(echo ${java_version}| cut -f1 -d .) package=openjdk${java_major_version} -# Use only the edge branch, to avoid world conflicts on openjdk, which is -# also on the release (e.g. v3.19) branch, now. The openjdk package will be in -# the community repository, while other utilities are in the main one. -echo https://dl-cdn.alpinelinux.org/alpine/edge/community >> /tmp/repositories.$$ -echo https://dl-cdn.alpinelinux.org/alpine/edge/main >> /tmp/repositories.$$ -apk --no-cache add ${package}-jdk=~${java_version} --repositories-file /tmp/repositories.$$ -rm /tmp/repositories.$$ - -apk --no-cache add binutils tar wget +# Use --force-broken-world as in GitHub, we had the following error not reproducible otherwise: +# > ERROR: unable to select packages: +# > openjdk21-jdk-21.0.2_p13-r2: +# > breaks: world[openjdk21-jdk~21.0.1_p12] +apk --no-cache --force-broken-world add ${package}-jdk=~${java_version} binutils tar wget # Typically, only amd64 is tested in CI: Run commands that ensure binaries match current arch. if ! java -version || ! jar --version || ! jlink --version; then maybe_log_crash; fi From 333e4441f86b2d9c6568c58cb781a295f05ba1c2 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 7 Feb 2024 09:52:39 +0700 Subject: [PATCH 11/14] revert to 3.19.0 Signed-off-by: Adrian Cole --- Dockerfile | 2 +- install.sh | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3f62155..62b80aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ # docker_parent_image is the base layer of full and jre image # # Use latest version here: https://github.com/orgs/openzipkin/packages/container/package/alpine -ARG docker_parent_image=ghcr.io/openzipkin/alpine:3.19.1 +ARG docker_parent_image=ghcr.io/openzipkin/alpine:3.19.0 # java_version and java_home are hard-coded here to allow the following: # * `docker build https://github.com/openzipkin/docker-java.git` diff --git a/install.sh b/install.sh index 7b817a6..2b83e42 100755 --- a/install.sh +++ b/install.sh @@ -31,11 +31,7 @@ maven_version=${2?maven_version is required. ex 3.9.6} java_major_version=$(echo ${java_version}| cut -f1 -d .) package=openjdk${java_major_version} -# Use --force-broken-world as in GitHub, we had the following error not reproducible otherwise: -# > ERROR: unable to select packages: -# > openjdk21-jdk-21.0.2_p13-r2: -# > breaks: world[openjdk21-jdk~21.0.1_p12] -apk --no-cache --force-broken-world add ${package}-jdk=~${java_version} binutils tar wget +apk --no-cache add ${package}-jdk=~${java_version} binutils tar wget # Typically, only amd64 is tested in CI: Run commands that ensure binaries match current arch. if ! java -version || ! jar --version || ! jlink --version; then maybe_log_crash; fi From 055632cbe06b7a9c89be2e9787c579fe1c30dd59 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 7 Feb 2024 10:08:24 +0700 Subject: [PATCH 12/14] old ubuntu Signed-off-by: Adrian Cole --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a98024d..9bc9b9f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ on: jobs: test: - runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish + runs-on: ubuntu-20.04 # newest available distribution, aka jellyfish steps: - name: Checkout Repository uses: actions/checkout@v4 From 6f0da56de13f5dbd7b417b4bc646609096ac208b Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 7 Feb 2024 10:09:34 +0700 Subject: [PATCH 13/14] don't mix! Signed-off-by: Adrian Cole --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9bc9b9f..6e15da0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ on: jobs: test: - runs-on: ubuntu-20.04 # newest available distribution, aka jellyfish + runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -25,6 +25,6 @@ jobs: # We can't cache Docker without using buildx because GH actions restricts /var/lib/docker # That's ok because DOCKER_PARENT_IMAGE is always ghcr.io and local anyway. - name: Test LTS JDK - run: build-bin/configure_test && build-bin/test 21.0.1_p12 + run: build-bin/configure_test && build-bin/test 21.0.2_p13 - name: Test latest JDK run: build-bin/configure_test && build-bin/test From 790f3e8114253327cbc0b53b9be15ebb90938a72 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 7 Feb 2024 10:20:57 +0700 Subject: [PATCH 14/14] separate tests Signed-off-by: Adrian Cole --- .github/workflows/test.yml | 15 +++++++++++---- Dockerfile | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e15da0..d562d6e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,16 @@ on: jobs: test: + name: test (${{ matrix.name }}) runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish + strategy: + fail-fast: false # don't fail fast as some failures are LTS specific + matrix: # match with maven-enforcer-plugin rules in pom.xml + include: + - name: build-arg + version: 21.0.2_p13 + - name: implicit + version: master steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -24,7 +33,5 @@ jobs: fetch-depth: 1 # only needed to get the sha label # We can't cache Docker without using buildx because GH actions restricts /var/lib/docker # That's ok because DOCKER_PARENT_IMAGE is always ghcr.io and local anyway. - - name: Test LTS JDK - run: build-bin/configure_test && build-bin/test 21.0.2_p13 - - name: Test latest JDK - run: build-bin/configure_test && build-bin/test + - name: Test + run: build-bin/configure_test && build-bin/test ${{ matrix.version }} diff --git a/Dockerfile b/Dockerfile index 62b80aa..3f62155 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ # docker_parent_image is the base layer of full and jre image # # Use latest version here: https://github.com/orgs/openzipkin/packages/container/package/alpine -ARG docker_parent_image=ghcr.io/openzipkin/alpine:3.19.0 +ARG docker_parent_image=ghcr.io/openzipkin/alpine:3.19.1 # java_version and java_home are hard-coded here to allow the following: # * `docker build https://github.com/openzipkin/docker-java.git`