Skip to content

Commit 38e58d4

Browse files
Updates to Alpine 3.20.3, Java 21.0.5_p11 and latest maven deps (#92)
Signed-off-by: Adrian Cole <[email protected]>
1 parent 8fa51a7 commit 38e58d4

File tree

6 files changed

+26
-23
lines changed

6 files changed

+26
-23
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
deploy:
14-
runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
14+
runs-on: ubuntu-24.04 # newest available distribution, aka numbat
1515
steps:
1616
- name: Checkout Repository
1717
uses: actions/checkout@v4

.github/workflows/security.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on: # yamllint disable-line rule:truthy
2323
jobs:
2424
security:
2525
name: security
26-
runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
26+
runs-on: ubuntu-24.04 # newest available distribution, aka numbat
2727
# skip commits made by the release plugin
2828
if: "!contains(github.event.head_commit.message, 'maven-release-plugin')"
2929
steps:
@@ -38,6 +38,9 @@ jobs:
3838
- name: Run Trivy vulnerability and secret scanner
3939
uses: aquasecurity/trivy-action@master
4040
id: trivy
41+
env: # See https://github.com/aquasecurity/trivy/discussions/7668
42+
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
43+
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db
4144
with:
4245
scan-type: 'fs'
4346
scan-ref: '.' # scan the entire repository

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ on:
1717
jobs:
1818
test:
1919
name: test (${{ matrix.name }})
20-
runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
20+
runs-on: ubuntu-24.04 # newest available distribution, aka numbat
2121
strategy:
2222
fail-fast: false # don't fail fast as some failures are LTS specific
2323
matrix: # match with maven-enforcer-plugin rules in pom.xml
2424
include:
2525
- name: build-arg
26-
version: 21.0.4_p7
26+
version: 21.0.5_p11
2727
- name: implicit
2828
version: master
2929
steps:

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# docker_parent_image is the base layer of full and jre image
77
#
88
# Use latest version here: https://github.com/orgs/openzipkin/packages/container/package/alpine
9-
ARG docker_parent_image=ghcr.io/openzipkin/alpine:3.20.2
9+
ARG docker_parent_image=ghcr.io/openzipkin/alpine:3.20.3
1010

1111
# java_version and java_home are hard-coded here to allow the following:
1212
# * `docker build https://github.com/openzipkin/docker-java.git`
@@ -17,17 +17,17 @@ ARG docker_parent_image=ghcr.io/openzipkin/alpine:3.20.2
1717
# When updating, also update the README
1818
# * Use current version from https://pkgs.alpinelinux.org/packages?name=openjdk21, stripping
1919
# the `-rX` at the end.
20-
ARG java_version=21.0.4_p7
20+
ARG java_version=21.0.5_p11
2121
ARG java_home=/usr/lib/jvm/java-21-openjdk
2222

2323
# We copy files from the context into a scratch container first to avoid a problem where docker and
2424
# docker-compose don't share layer hashes https://github.com/docker/compose/issues/883 normally.
2525
# COPY --from= works around the issue.
26-
FROM scratch as code
26+
FROM scratch AS code
2727

2828
COPY . /code/
2929

30-
FROM $docker_parent_image as base
30+
FROM $docker_parent_image AS base
3131

3232
# java_version is hard-coded here to allow the following to work:
3333
# * `docker build https://github.com/openzipkin/docker-java.git`
@@ -51,17 +51,17 @@ WORKDIR /java
5151
ENTRYPOINT ["java", "-jar"]
5252

5353
# The JDK image includes a few build utilities and Maven
54-
FROM base as jdk
54+
FROM base AS jdk
5555
LABEL org.opencontainers.image.description="OpenJDK on Alpine Linux"
5656
ARG java_version
57-
ARG maven_version=3.9.8
57+
ARG maven_version=3.9.9
5858
LABEL maven-version=$maven_version
5959

6060
COPY --from=code /code/install.sh .
6161
RUN ./install.sh $java_version $maven_version && rm install.sh
6262

6363
# Use a temporary target to build a JRE using the JDK we just built
64-
FROM jdk as install
64+
FROM jdk AS install
6565

6666
WORKDIR /install
6767

@@ -92,7 +92,7 @@ jdk.localedata --include-locales en \
9292
--output jre
9393

9494
# Our JRE image is minimal: Only Alpine, gcompat and a stripped down JRE
95-
FROM base as jre
95+
FROM base AS jre
9696
LABEL org.opencontainers.image.description="Minimal OpenJDK JRE on Alpine Linux"
9797

9898
COPY --from=install /install/jre/ ${JAVA_HOME}/

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This is an internal base layer primarily used in [zipkin](https://github.com/ope
1515

1616
To try the image, run the `java -version` command:
1717
```bash
18-
$ docker run --rm ghcr.io/openzipkin/java:21.0.4_p7 -version
18+
$ docker run --rm ghcr.io/openzipkin/java:21.0.5_p11 -version
1919
openjdk version "21.0.4" 2024-07-16
2020
OpenJDK Runtime Environment (build 21.0.4+7-alpine-r0)
2121
OpenJDK 64-Bit Server VM (build 21.0.4+7-alpine-r0, mixed mode, sharing)
@@ -39,26 +39,26 @@ Build the [Dockerfile](Dockerfile) using the current version without the
3939
revision classifier from here:
4040
* https://pkgs.alpinelinux.org/packages?name=openjdk21
4141
```bash
42-
# Note 21.0.4_p7 not 21.0.4_p7-r2!
43-
./build-bin/build 21.0.4_p7
42+
# Note 21.0.5_p11 not 21.0.5_p11-r2!
43+
./build-bin/build 21.0.5_p11
4444
```
4545

4646
Next, verify the built image matches that version:
4747
```bash
4848
$ docker run --rm openzipkin/java:test -version
49-
openjdk version "21.0.4" 2024-07-16
50-
OpenJDK Runtime Environment (build 21.0.4+7-alpine-r0)
51-
OpenJDK 64-Bit Server VM (build 21.0.4+7-alpine-r0, mixed mode, sharing)
49+
openjdk version "21.0.5" 2024-10-15
50+
OpenJDK Runtime Environment (build 21.0.5+11-alpine-r0)
51+
OpenJDK 64-Bit Server VM (build 21.0.5+11-alpine-r0, mixed mode, sharing)
5252
```
5353

54-
To release the image, push a tag matching the arg to `build-bin/build` (ex `21.0.4_p7`).
54+
To release the image, push a tag matching the arg to `build-bin/build` (ex `21.0.5_p11`).
5555
This triggers a [GitHub Actions](https://github.com/openzipkin/docker-java/actions) job to push the image.
5656

5757
## java.lang.ClassNotFoundException
5858

5959
The image ending in `-jre` is stripped to only retain the minimal modules needed by Zipkin. This is
6060
to make it as small as possible. If the `zipkin` or `zipkin-slim` images fail with a
61-
`java.lang.ClassNotFoundException`, it may be related to the modules linked in the [Dockerfile][Dockerfile].
61+
`java.lang.ClassNotFoundException`, it may be related to the modules linked in the [Dockerfile](Dockerfile).
6262

6363
If the package begins with `java.`, `sun.` or `com.sun.`, it is likely a JRE module. To verify, use
6464
`javap` without any other options. If a result is printed, you need to link a corresponding module.

install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ maybe_log_crash() {
1919
}
2020

2121
java_version=${1?java_version is required. ex --strip-debug}
22-
maven_version=${2?maven_version is required. ex 3.9.8}
22+
maven_version=${2?maven_version is required. ex 3.9.9}
2323
java_major_version=$(echo ${java_version}| cut -f1 -d .)
2424
package=openjdk${java_major_version}
2525

@@ -43,5 +43,5 @@ apache_backup_mirror=https://downloads.apache.org/
4343
(wget ${apache_mirror}${maven_dist_path} || wget ${apache_backup_mirror}${maven_dist_path}) | tar xz --strip=1 -C maven
4444
ln -s ${PWD}/maven/bin/mvn /usr/bin/mvn
4545

46-
mvn -q --batch-mode org.apache.maven.plugins:maven-help-plugin:3.4.1:evaluate -Dexpression=maven.version -q -DforceStdout || maybe_log_crash
47-
mvn -q --batch-mode org.apache.maven.plugins:maven-dependency-plugin:3.7.1:get -Dmdep.skip
46+
mvn -q --batch-mode org.apache.maven.plugins:maven-help-plugin:3.5.1:evaluate -Dexpression=maven.version -q -DforceStdout || maybe_log_crash
47+
mvn -q --batch-mode org.apache.maven.plugins:maven-dependency-plugin:3.8.1:get -Dmdep.skip

0 commit comments

Comments
 (0)