Skip to content

Commit 5d1f3f9

Browse files
Updates to Alpine 3.20.3, Java 17.0.13_p11 and latest maven deps
Signed-off-by: Adrian Cole <[email protected]>
1 parent fd2b54a commit 5d1f3f9

File tree

6 files changed

+84
-25
lines changed

6 files changed

+84
-25
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: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: security
3+
4+
# We don't scan documentation-only commits.
5+
on: # yamllint disable-line rule:truthy
6+
push: # non-tagged pushes to master
7+
branches:
8+
- master
9+
tags-ignore:
10+
- '*'
11+
paths-ignore:
12+
- '**/*.md'
13+
- './build-bin/*lint'
14+
- ./build-bin/mlc_config.json
15+
pull_request: # pull requests targeted at the master branch.
16+
branches:
17+
- master
18+
paths-ignore:
19+
- '**/*.md'
20+
- './build-bin/*lint'
21+
- ./build-bin/mlc_config.json
22+
23+
jobs:
24+
security:
25+
name: security
26+
runs-on: ubuntu-24.04 # newest available distribution, aka numbat
27+
# skip commits made by the release plugin
28+
if: "!contains(github.event.head_commit.message, 'maven-release-plugin')"
29+
steps:
30+
- name: Checkout Repository
31+
uses: actions/checkout@v4
32+
- uses: actions/cache@v4
33+
name: Cache Trivy Database
34+
with:
35+
path: .trivy
36+
key: ${{ runner.os }}-trivy
37+
restore-keys: ${{ runner.os }}-trivy
38+
- name: Run Trivy vulnerability and secret scanner
39+
uses: aquasecurity/trivy-action@master
40+
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
44+
with:
45+
scan-type: 'fs'
46+
scan-ref: '.' # scan the entire repository
47+
scanners: vuln,secret
48+
exit-code: '1'
49+
severity: HIGH,CRITICAL
50+
output: trivy-report.md
51+
cache-dir: .trivy
52+
- name: Set Summary
53+
shell: bash
54+
if: ${{ failure() && steps.trivy.conclusion == 'failure' }}
55+
# Add the Trivy report to the summary
56+
#
57+
# Note: This will cause a workflow error if trivy-report.md > the step
58+
# limit 1MiB. If this was due to too many CVEs, consider fixing them ;)
59+
run: cat trivy-report.md >> $GITHUB_STEP_SUMMARY

.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: 17.0.12_p7
26+
version: 17.0.13_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=openjdk17, stripping
1919
# the `-rX` at the end.
20-
ARG java_version=17.0.12_p7
20+
ARG java_version=17.0.13_p11
2121
ARG java_home=/usr/lib/jvm/java-17-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

@@ -93,7 +93,7 @@ jdk.localedata --include-locales en \
9393
--output jre
9494

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

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

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ 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:17.0.12_p7 -version
19-
openjdk version "17.0.12" 2024-07-16
20-
OpenJDK Runtime Environment (build 17.0.12+7-alpine-r0)
21-
OpenJDK 64-Bit Server VM (build 17.0.12+7-alpine-r0, mixed mode, sharing)
18+
$ docker run --rm ghcr.io/openzipkin/java:17.0.13_p11 -version
19+
openjdk version "17.0.13" 2024-10-15
20+
OpenJDK Runtime Environment (build 17.0.13+11-alpine-r0)
21+
OpenJDK 64-Bit Server VM (build 17.0.13+11-alpine-r0, mixed mode, sharing)
2222
```
2323

2424
## Release process
@@ -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=openjdk17
4141
```bash
42-
# Note 17.0.12_p7 not 17.0.12_p7-r2!
43-
./build-bin/build 17.0.12_p7
42+
# Note 17.0.13_p11 not 17.0.13_p11-r2!
43+
./build-bin/build 17.0.13_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 "17.0.12" 2024-07-16
50-
OpenJDK Runtime Environment (build 17.0.12+7-alpine-r0)
51-
OpenJDK 64-Bit Server VM (build 17.0.12+7-alpine-r0, mixed mode, sharing)
49+
openjdk version "17.0.13" 2024-10-15
50+
OpenJDK Runtime Environment (build 17.0.13+11-alpine-r0)
51+
OpenJDK 64-Bit Server VM (build 17.0.13+11-alpine-r0, mixed mode, sharing)
5252
```
5353

54-
To release the image, push a tag matching the arg to `build-bin/build` (ex `17.0.12_p7`).
54+
To release the image, push a tag matching the arg to `build-bin/build` (ex `17.0.13_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)