Skip to content

Commit

Permalink
feat: adds Java 21 support (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
timbru31 authored Jan 8, 2024
1 parent a849ebd commit 80f095e
Show file tree
Hide file tree
Showing 12 changed files with 213 additions and 9 deletions.
38 changes: 35 additions & 3 deletions .github/workflows/buildx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,55 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7

- path: 17/jdk/20/alpine
tags: "alpine-jdk-20 alpine-jdk-iron 17-alpine-jdk-20 17-alpine-jdk-iron"
tags: "17-alpine-jdk-20 17-alpine-jdk-iron"
platforms: linux/amd64

- path: 17/jre/18
tags: "17-18 17-hydrogen 17-jre-18 17-jre-hydrogen"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7

- path: 17/jre/18/alpine
tags: "17-alpine-18 17-alpine-hydrogen 17-alpine-jre-18 17-alpine-jre-hydrogen alpine-18 alpine-hydrogen alpine-jre-18 alpine-jre-hydrogen"
tags: "17-alpine-18 17-alpine-hydrogen 17-alpine-jre-18 17-alpine-jre-hydrogen"
platforms: linux/amd64

- path: 17/jre/20
tags: "17-20 17-iron 17-jre-20 17-jre-iron"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7

- path: 17/jre/20/alpine
tags: "17-alpine-20 17-alpine-iron 17-alpine-jre-20 17-alpine-jre-iron alpine-20 alpine-iron alpine-jre-20 alpine-jre-iron"
tags: "17-alpine-20 17-alpine-iron 17-alpine-jre-20 17-alpine-jre-iron"
platforms: linux/amd64

- path: 21/jdk/18
tags: "21-jdk-18 21-jdk-hydrogen jdk-18 jdk-18-hydrogen"
platforms: linux/amd64,linux/arm64,linux/ppc64le

- path: 21/jdk/18/alpine
tags: "alpine-jdk-18 alpine-jdk-hydrogen 21-alpine-jdk-18 21-alpine-jdk-hydrogen"
platforms: linux/amd64

- path: 21/jdk/20
tags: "21-jdk-20 21-jdk-iron jdk-20 jdk-20-iron"
platforms: linux/amd64,linux/arm64,linux/ppc64le

- path: 21/jdk/20/alpine
tags: "alpine-jdk-20 alpine-jdk-iron 21-alpine-jdk-20 21-alpine-jdk-iron"
platforms: linux/amd64

- path: 21/jre/18
tags: "21-18 21-hydrogen 21-jre-18 21-jre-hydrogen"
platforms: linux/amd64,linux/arm64,linux/ppc64le

- path: 21/jre/18/alpine
tags: "21-alpine-18 21-alpine-hydrogen 21-alpine-jre-18 21-alpine-jre-hydrogen alpine-18 alpine-hydrogen alpine-jre-18 alpine-jre-hydrogen"
platforms: linux/amd64

- path: 21/jre/20
tags: "21-20 21-iron 21-jre-20 21-jre-iron"
platforms: linux/amd64,linux/arm64,linux/ppc64le

- path: 21/jre/20/alpine
tags: "21-alpine-20 21-alpine-iron 21-alpine-jre-20 21-alpine-jre-iron alpine-20 alpine-iron alpine-jre-20 alpine-jre-iron"
platforms: linux/amd64
steps:
- name: Checkout
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,26 @@ jobs:
printf "\n\nJRE17 alpine with Node.js 20\n"
docker run -i $(docker build -q 17/jre/20/alpine) /bin/sh -c "java -version && node --version"
printf "\n\nJDK21 with Node.js 18\n"
docker run -i $(docker build -q 21/jdk/18) /bin/sh -c "java -version && node --version"
printf "\n\nJDK21 alpine with Node.js 18\n"
docker run -i $(docker build -q 21/jdk/18/alpine) /bin/sh -c "java -version && node --version"
printf "\n\nJDK21 with Node.js 20\n"
docker run -i $(docker build -q 21/jdk/20) /bin/sh -c "java -version && node --version"
printf "\n\nJDK21 alpine with Node.js 20\n"
docker run -i $(docker build -q 21/jdk/20/alpine) /bin/sh -c "java -version && node --version"
printf "\n\nJRE21 with Node.js 18\n"
docker run -i $(docker build -q 21/jre/18) /bin/sh -c "java -version && node --version"
printf "\n\nJRE21 alpine with Node.js 18\n"
docker run -i $(docker build -q 21/jre/18/alpine) /bin/sh -c "java -version && node --version"
printf "\n\nJRE21 with Node.js 20\n"
docker run -i $(docker build -q 21/jre/20) /bin/sh -c "java -version && node --version"
printf "\n\nJRE21 alpine with Node.js 20\n"
docker run -i $(docker build -q 21/jre/20/alpine) /bin/sh -c "java -version && node --version"
auto-merge:
runs-on: ubuntu-latest
needs: build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
- run: brew install hadolint

- run: |
hadolint {8,11,17}/**/**/*Dockerfile
hadolint {8,11,17}/**/**/**/*Dockerfile
hadolint {8,11,17,21}/**/**/*Dockerfile
hadolint {8,11,17,21}/**/**/**/*Dockerfile
25 changes: 25 additions & 0 deletions 21/jdk/18/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM eclipse-temurin:21-jdk
LABEL maintainer "Tim Brust <[email protected]>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT
ARG NODE_MAJOR=18

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN printf 'Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 1001' > /etc/apt/preferences.d/nodesource \
&& mkdir -p /etc/apt/keyrings \
&& apt-get update -qq \
&& apt-get install -qq --no-install-recommends \
gpg \
gpg-agent \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update -qq \
&& apt-get install -qq --no-install-recommends \
nodejs \
yarn \
&& apt-get upgrade -qq \
&& rm -rf /var/lib/apt/lists/*
12 changes: 12 additions & 0 deletions 21/jdk/18/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM eclipse-temurin:21-jdk-alpine
LABEL maintainer "Tim Brust <[email protected]>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT

RUN apk -U upgrade \
&& apk add --no-cache \
"nodejs<20" \
npm \
yarn \
curl
25 changes: 25 additions & 0 deletions 21/jdk/20/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM eclipse-temurin:21-jdk
LABEL maintainer "Tim Brust <[email protected]>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT
ARG NODE_MAJOR=20

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN printf 'Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 1001' > /etc/apt/preferences.d/nodesource \
&& mkdir -p /etc/apt/keyrings \
&& apt-get update -qq \
&& apt-get install -qq --no-install-recommends \
gpg \
gpg-agent \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update -qq \
&& apt-get install -qq --no-install-recommends \
nodejs \
yarn \
&& apt-get upgrade -qq \
&& rm -rf /var/lib/apt/lists/*
14 changes: 14 additions & 0 deletions 21/jdk/20/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM eclipse-temurin:21-jdk-alpine
LABEL maintainer "Tim Brust <[email protected]>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT

RUN echo @edge https://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories \
&& echo @edge https://dl-cdn.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories \
&& apk -U upgrade \
&& apk add --no-cache \
nodejs@edge \
npm@edge \
yarn \
curl
25 changes: 25 additions & 0 deletions 21/jre/18/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM eclipse-temurin:21-jre
LABEL maintainer "Tim Brust <[email protected]>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT
ARG NODE_MAJOR=18

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN printf 'Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 1001' > /etc/apt/preferences.d/nodesource \
&& mkdir -p /etc/apt/keyrings \
&& apt-get update -qq \
&& apt-get install -qq --no-install-recommends \
gpg \
gpg-agent \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update -qq \
&& apt-get install -qq --no-install-recommends \
nodejs \
yarn \
&& apt-get upgrade -qq \
&& rm -rf /var/lib/apt/lists/*
12 changes: 12 additions & 0 deletions 21/jre/18/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM eclipse-temurin:21-jre-alpine
LABEL maintainer "Tim Brust <[email protected]>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT

RUN apk -U upgrade \
&& apk add --no-cache \
"nodejs<20" \
npm \
yarn \
curl
25 changes: 25 additions & 0 deletions 21/jre/20/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM eclipse-temurin:21-jre
LABEL maintainer "Tim Brust <[email protected]>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT
ARG NODE_MAJOR=20

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN printf 'Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 1001' > /etc/apt/preferences.d/nodesource \
&& mkdir -p /etc/apt/keyrings \
&& apt-get update -qq \
&& apt-get install -qq --no-install-recommends \
gpg \
gpg-agent \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update -qq \
&& apt-get install -qq --no-install-recommends \
nodejs \
yarn \
&& apt-get upgrade -qq \
&& rm -rf /var/lib/apt/lists/*
14 changes: 14 additions & 0 deletions 21/jre/20/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM eclipse-temurin:21-jre-alpine
LABEL maintainer "Tim Brust <[email protected]>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT

RUN echo @edge https://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories \
&& echo @edge https://dl-cdn.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories \
&& apk -U upgrade \
&& apk add --no-cache \
nodejs@edge \
npm@edge \
yarn \
curl
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Java (JRE or JDK version 8, 11 or 17) with Node.js 18 LTS (Hydrogen) or Node.js 20 LTS (Iron) Dockerfile
# Java (JRE or JDK version 8, 11, 17 or 21) with Node.js 18 LTS (Hydrogen) or Node.js 20 LTS (Iron) Dockerfile

[![Docker Automated build](https://img.shields.io/docker/automated/timbru31/java-node.svg)](https://hub.docker.com/r/timbru31/java-node/)
[![buildx Status](https://github.com/timbru31/docker-java-node/workflows/buildx/badge.svg)](https://github.com/timbru31/docker-java-node/actions?query=workflow%3Abuildx)
[![Lint Dockerfiles](https://github.com/timbru31/docker-java-node/workflows/Lint%20Dockerfiles/badge.svg)](https://github.com/timbru31/docker-java-node/actions?query=workflow%3A%22Lint+Dockerfiles%22)

A minimal Dockerfile based on Eclipse Temurin's OpenJDK JRE or JDK 8/11 Dockerfile (regular, alpine) with Node.js 18 LTS (Hydrogen) or Node.js 20 LTS (Iron) installed.
A minimal Dockerfile based on Eclipse Temurin's OpenJDK JRE or JDK 8/11/17/21 Dockerfile (regular, alpine) with Node.js 18 LTS (Hydrogen) or Node.js 20 LTS (Iron) installed.

## What's included

- JRE or JDK 8/11/17
- JRE or JDK 8/11/17/21
- Node.js 18 LTS (Hydrogen) or Node.js 20 LTS (Iron)
- bundled npm that comes with the respective Node.js version (latest for Node.js on alpine, see [why](https://gitlab.alpinelinux.org/alpine/aports/-/commit/25b10bd1a93e12a7e49fee38b0a229281ae49fb7))
- yarn
Expand All @@ -20,7 +20,7 @@ These Dockerfiles leverage the new `buildx` functionality and offer the followin

- linux/amd64
- linux/arm64 (not for alpine)
- linux/arm/v8 (not for alpine)
- linux/arm/v7 (not for alpine, not for Java 21)
- linux/ppc64le (not for alpine)

---
Expand Down

0 comments on commit 80f095e

Please sign in to comment.