Skip to content

Commit

Permalink
deps: alpine 3.19.1 (#85)
Browse files Browse the repository at this point in the history
also fixes the test job so that it doesn't cache layers when it shouldn't due to differing build args.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
  • Loading branch information
codefromthecrypt committed Feb 7, 2024
1 parent 0dccfec commit effbc94
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 20 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,22 @@ 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
with:
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.1_p12
- name: Test latest JDK
run: build-bin/configure_test && build-bin/test
- name: Test
run: build-bin/configure_test && build-bin/test ${{ matrix.version }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,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}

apk --no-cache add \
${package}-jmods=~${java_version} ${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
Expand Down

0 comments on commit effbc94

Please sign in to comment.