Skip to content

Commit

Permalink
Add java-jre21 + Update java-jre20
Browse files Browse the repository at this point in the history
  • Loading branch information
hwalker928 authored Dec 3, 2023
1 parent 8f6baa5 commit b382f6f
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/java-jre21.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build java-jre21
on:
push:
branches:
- main
paths:
- java/java-jre21/*
- java/entrypoint.sh
- .github/workflows/java-jre21.yml
jobs:
push:
name: "java-jre21"
runs-on: self-hosted
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
with:
version: "v0.9.1"
buildkitd-flags: --debug
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v3
with:
context: ./java
file: ./java/java-jre21/Dockerfile
platforms: linux/amd64
push: true
tags: |
ghcr.io/sparkedhost/images:java-jre21
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [`java-jre18`](https://github.com/sparkedhost/images/blob/main/java/java-jre18/Dockerfile)[^eol]
- [`java-jre19`](https://github.com/sparkedhost/images/blob/main/java/java-jre19/Dockerfile)[^eol]
- [`java-jre20`](https://github.com/sparkedhost/images/blob/main/java/java-jre20/Dockerfile)[^eol]
- [`java-jre21`](https://github.com/sparkedhost/images/blob/main/java/java-jre21/Dockerfile)
- [`anti-malware`](https://github.com/sparkedhost/images/blob/main/java/anti-malware/Dockerfile)[^antimalware]

### Node.js images
Expand Down
2 changes: 1 addition & 1 deletion java/java-jre20/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN apt-get update -y \
&& mkdir -p /opt/java

# Download pre-built Temurin JRE binaries
ADD https://github.com/adoptium/temurin20-binaries/releases/download/jdk-20.0.1%2B9/OpenJDK20U-jre_x64_linux_hotspot_20.0.1_9.tar.gz /opt/java/java.tar.gz
ADD https://github.com/adoptium/temurin20-binaries/releases/download/jdk-20.0.2%2B9/OpenJDK20U-jre_x64_linux_hotspot_20.0.2_9.tar.gz /opt/java/java.tar.gz
RUN tar -C /opt/java --strip-components=1 -xzf /opt/java/java.tar.gz \
&& rm -f /opt/java/java.tar.gz

Expand Down
34 changes: 34 additions & 0 deletions java/java-jre21/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# ----------------------------------
# Sparked Host Custom Docker Image
# Image: ghcr.io/sparkedhost/images:java-jre21
# ----------------------------------

FROM debian:bullseye-slim

LABEL author="DevOps Team at Sparked Host" maintainer="sysadmin@sparkedhost.com"

RUN apt-get update -y \
&& apt-get install fontconfig iproute2 curl ca-certificates tar -y \
&& useradd -d /home/container -m container \
&& mkdir -p /opt/java

# Download pre-built Temurin JRE binaries
ADD https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jre_x64_linux_hotspot_21.0.1_12.tar.gz /opt/java/java.tar.gz
RUN tar -C /opt/java --strip-components=1 -xzf /opt/java/java.tar.gz \
&& rm -f /opt/java/java.tar.gz

# Add Sparked certificate authority
ADD ca.crt /usr/local/share/ca-certificates/sparked-ca.crt
RUN chmod 644 /usr/local/share/ca-certificates/sparked-ca.crt && update-ca-certificates

# Set user that will run the entrypoint script, and overwrite USER, HOME and PATH environment variables
# We need to inject the path to the Java binaries in the PATH environment variable
USER container
ENV USER=container HOME=/home/container PATH="$PATH:/opt/java/bin" LANG=C.UTF-8

WORKDIR /home/container

COPY ./entrypoint.sh /entrypoint.sh

CMD ["/bin/bash", "/entrypoint.sh"]

0 comments on commit b382f6f

Please sign in to comment.