diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4ccb76f..6fa18c0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,7 +7,7 @@ name: deploy # See https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet on: push: - tags: '[0-9]+.[0-9]+.[0-9]+**' # Ex. 8.472.08 or 21.0.10_p7 + tags: '[0-9]+.[0-9]+.[0-9]+**' # Ex. 8.472.08 or 25.0.2_p10 jobs: deploy: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 82d0f83..15e692e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: matrix: # match with maven-enforcer-plugin rules in pom.xml include: - name: build-arg - version: 21.0.10_p7 + version: 25.0.2_p10 - name: implicit version: master steps: diff --git a/.gitignore b/.gitignore index 0cdcd67..bc8776b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,28 @@ +*~ +#* +*# +.#* +dependency-reduced-pom.xml +.factorypath +.classpath +.project +.settings/ +.springBeans +target/ +_site/ .idea *.iml -*.ipr -*.iws +*.swp +# quickstart or temporary copies of zipkin's jar +/*.jar +# temporary directory used by build-bin/javadoc_to_gh_pages for building gh-pages +/javadoc-builddir +.DS_Store + +# This project does not use Gradle but some developers may use it to e.g., setup a Node environment. +# It doesn't hurt to just exclude it here. +.gradle + +# This project does not use Yarn but some developers may use it to e.g., start zipkin-lens dev server. +# It doesn't hurt to just exclude it here. +yarn.lock diff --git a/Dockerfile b/Dockerfile index 29dd79d..aaf9817 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# This builds a base JDK and JRE 11+ image that also includes a working shell +# This can build a base JDK and JRE image for Java 11, 21 and 25 that also includes a working shell. # # You can choose to lint this via the following command: # docker run --rm -i hadolint/hadolint < Dockerfile @@ -12,20 +12,13 @@ ARG docker_parent_image=ghcr.io/openzipkin/alpine:3.23.3 # * `docker build https://github.com/openzipkin/docker-java.git` # # These are overridden via build-bin/docker/docker_args, ensuring the two are -# coherent (e.g. java 21.* has a java_home of java-21-openjdk). +# coherent (e.g. java 25.* has a java_home of java-25-openjdk). # # When updating, also update the README -# * Use current version from https://pkgs.alpinelinux.org/packages?name=openjdk21, stripping +# * Use current version from https://pkgs.alpinelinux.org/packages?name=openjdk25, stripping # the `-rX` at the end. -ARG java_version=21.0.10_p7 -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 -# docker-compose don't share layer hashes https://github.com/docker/compose/issues/883 normally. -# COPY --from= works around the issue. -FROM scratch AS code - -COPY install.sh /code/ +ARG java_version=25.0.2_p10 +ARG java_home=/usr/lib/jvm/java-25-openjdk FROM $docker_parent_image AS base @@ -33,7 +26,7 @@ FROM $docker_parent_image AS base # * `docker build https://github.com/openzipkin/docker-java.git` # # When updating, also update the README -# * Use current version from https://pkgs.alpinelinux.org/packages?name=openjdk21 +# * Use current version from https://pkgs.alpinelinux.org/packages?name=openjdk25 # This is defined in many places because Docker has no "env" script functionality unless you use # docker-compose: When updating, update everywhere. ARG java_version @@ -61,7 +54,7 @@ LABEL maven-version=$maven_version # Disable hardware crypto intrinsics so Maven can download from Central on all architectures. ENV MAVEN_OPTS="-XX:+UnlockDiagnosticVMOptions -XX:-UseAES -XX:-UseAESIntrinsics -XX:-UseAESCTRIntrinsics -XX:-UseGHASHIntrinsics -XX:-UseSHA" -COPY --from=code /code/install.sh . +COPY install.sh . RUN ./install.sh $java_version $maven_version && rm install.sh # Use a temporary target to build a JRE using the JDK we just built @@ -69,7 +62,7 @@ FROM jdk AS install WORKDIR /install -# Included modules cherry-picked from https://docs.oracle.com/en/java/javase/21/docs/api/ +# Included modules cherry-picked from https://docs.oracle.com/en/java/javase/25/docs/api/ # # Note: Only include modules needed for the openzipkin/zipkin and # openzipkin/zipkin-slim images. It is fine for test images to use a full JRE. diff --git a/README.md b/README.md index 35fcc8b..8092810 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ GitHub Container Registry: [ghcr.io/openzipkin/java](https://github.com/orgs/openzipkin/packages/container/package/java) includes: * `master` tag: latest commit - * `MAJOR.MINOR.PATCH` tag: release corresponding to a [Current OpenJDK Version](https://pkgs.alpinelinux.org/packages?name=openjdk21) + * `MAJOR.MINOR.PATCH` tag: release corresponding to a [Current OpenJDK Version](https://pkgs.alpinelinux.org/packages?name=openjdk25) Tags ending in `-jre` include only a JRE where unqualified tags include the full JDK, Maven, and a few build utilities. @@ -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.10_p7 -version -openjdk version "21.0.10" 2026-01-20 -OpenJDK Runtime Environment (build 21.0.10+7-alpine-r0) -OpenJDK 64-Bit Server VM (build 21.0.10+7-alpine-r0, mixed mode, sharing) +$ docker run --rm ghcr.io/openzipkin/java:25.0.2_p10 -version +openjdk version "25.0.2" 2026-01-20 +OpenJDK Runtime Environment (build 25.0.2+10-alpine-r1) +OpenJDK 64-Bit Server VM (build 25.0.2+10-alpine-r1, mixed mode, sharing) ``` ## Release process @@ -37,21 +37,21 @@ before continuing. Notably, this avoids missing CVE fixes by mistake. Build the [Dockerfile](Dockerfile) using the current version without the revision classifier from here: - * https://pkgs.alpinelinux.org/packages?name=openjdk21 + * https://pkgs.alpinelinux.org/packages?name=openjdk25 ```bash -# Note 21.0.10_p7 not 21.0.10_p7-r0! -./build-bin/build 21.0.10_p7 +# Note 25.0.2_p10 not 25.0.2_p10-r0! +./build-bin/build 25.0.2_p10 ``` Next, verify the built image matches that version: ```bash $ docker run --rm openzipkin/java:test -version -openjdk version "21.0.10" 2026-01-20 -OpenJDK Runtime Environment (build 21.0.10+7-alpine-r0) -OpenJDK 64-Bit Server VM (build 21.0.10+7-alpine-r0, mixed mode, sharing) +openjdk version "25.0.2" 2026-01-20 +OpenJDK Runtime Environment (build 25.0.2+10-alpine-r1) +OpenJDK 64-Bit Server VM (build 25.0.2+10-alpine-r1, mixed mode, sharing) ``` -To release the image, push a tag matching the arg to `build-bin/build` (ex `21.0.10_p7`). +To release the image, push a tag matching the arg to `build-bin/build` (ex `25.0.2_p10`). This triggers a [GitHub Actions](https://github.com/openzipkin/docker-java/actions) job to push the image. ## java.lang.ClassNotFoundException @@ -81,7 +81,7 @@ This builds JDK and JRE images over our [Alpine Linux](https://github.com/openzi base layer. If you have any platform CVEs that relate to the Alpine version, check there first and cut a new version as necessary. -Specifically, this adds [Alpine's OpenJDK](https://pkgs.alpinelinux.org/packages?name=openjdk21) +Specifically, this adds [Alpine's OpenJDK](https://pkgs.alpinelinux.org/packages?name=openjdk25) package as well as Maven (to reduce image layers). If there is a concern about CVEs, check to see if there is a newer JDK available and release it. diff --git a/build-bin/README.md b/build-bin/README.md index 843ce4f..d50cdb5 100644 --- a/build-bin/README.md +++ b/build-bin/README.md @@ -19,7 +19,7 @@ These scripts serve a second purpose, which is to facilitate manual releases, wh happened many times due usually to service outages of CI providers. While tempting to use CI-provider specific tools, doing so can easily create a dependency where no one knows how to release anymore. Do not use provider-specific mechanisms to implement release flow. Instead, -automate triggering of the scripts here. +automate triggering of the scripts here. The only scripts that should be modified per project are in the base directory. Those in sub directories, such as [docker], should not vary project to project except accident of version drift. @@ -27,7 +27,7 @@ Intentional changes in sub directories should be relevant and tested on multiple they can be blindly copy/pasted. Conversely, the files in the base directory are project specific entry-points for test and deploy -actions and are entirely appropriate to vary per project. Here's an overview: +actions and are entirely appropriate to vary per project. Here's an overview: ## Test @@ -45,7 +45,7 @@ that license headers or other git analysis can take place. A simplest GitHub Actions `test.yml` runs tests after configuring them, but only on relevant event conditions. The name `test.yml` and job `test` allows easy references to status badges and parity of the scripts it uses. - + The `on:` section obviates job creation and resource usage for irrelevant events. Notably, GitHub Actions includes the ability to skip documentation-only jobs. @@ -88,7 +88,7 @@ the commit is documentation only or not. A simplest GitHub Actions `deploy.yml` deploys after logging in, but only on relevant event conditions. The name `deploy.yml` and job `deploy` allows easy references to status badges and parity of the scripts it uses. - + The `on:` section obviates job creation and resource usage for irrelevant events. GitHub Actions cannot implement "master, except documentation only-commits" in the same file. Hence, deployments of master will happen even on README change. @@ -99,7 +99,7 @@ explicitly defined and `on.tags` is a [glob pattern](https://docs.github.com/en/ ```yaml on: push: - tags: '[0-9]+.[0-9]+.[0-9]+**' # e.g. 8.472.08 or 21.0.10_p7 + tags: '[0-9]+.[0-9]+.[0-9]+**' # e.g. 8.472.08 or 25.0.2_p10 branches: master jobs: diff --git a/build-bin/docker/docker_args b/build-bin/docker/docker_args index 77e0729..53744e3 100755 --- a/build-bin/docker/docker_args +++ b/build-bin/docker/docker_args @@ -37,10 +37,14 @@ if [ -n "${DOCKER_TARGET}" ]; then fi # When non-empty, becomes the base layer including tag appropriate for the image being built. -# e.g. ghcr.io/openzipkin/java:21.0.10_p7-jre +# e.g. ghcr.io/openzipkin/java:25.0.2_p10-jre # # This is not required to be a base (FROM scratch) image like ghcr.io/openzipkin/alpine:3.12.3 # See https://docs.docker.com/glossary/#parent-image +if [ -n "${DOCKER_BUILD_IMAGE}" ]; then + docker_args="${docker_args} --build-arg docker_build_image=${DOCKER_BUILD_IMAGE}" +fi + if [ -n "${DOCKER_PARENT_IMAGE}" ]; then docker_args="${docker_args} --build-arg docker_parent_image=${DOCKER_PARENT_IMAGE}" fi @@ -51,7 +55,7 @@ if [ -n "${ALPINE_VERSION}" ]; then docker_args="${docker_args} --build-arg alpine_version=${ALPINE_VERSION}" fi -# When non-empty, becomes the build-arg java_version. e.g. "21.0.10_p7" +# When non-empty, becomes the build-arg java_version. e.g. "25.0.2_p10" # Used to align base layers from https://github.com/orgs/openzipkin/packages/container/package/java if [ -n "${JAVA_VERSION}" ]; then docker_args="${docker_args} --build-arg java_version=${JAVA_VERSION}" diff --git a/install.sh b/install.sh index 1a38ec9..cf78e89 100755 --- a/install.sh +++ b/install.sh @@ -5,7 +5,7 @@ # # Install OS packages that support most software we build -# * openjdk21-jdk: smaller than openjdk21, which includes docs and demos +# * openjdk25-jdk: smaller than openjdk25, which includes docs and demos # * 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