-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f6baa5
commit b382f6f
Showing
4 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
|