Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
28 changes: 26 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never mind this stuff it is just a copy of zipkin and don't care it has too much


# 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
23 changes: 8 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -12,28 +12,21 @@ 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

# java_version is hard-coded here to allow the following to work:
# * `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
Expand Down Expand Up @@ -61,15 +54,15 @@ 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
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.
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.

Expand Down
10 changes: 5 additions & 5 deletions build-bin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ 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.
Intentional changes in sub directories should be relevant and tested on multiple projects to ensure
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

Expand All @@ -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.

Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions build-bin/docker/docker_args
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading