-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
34 lines (24 loc) · 1.31 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# ----------------------------------
# Sparked Host Custom Docker Image
# Image: ghcr.io/sparkedhost/images:java-jre20
# ----------------------------------
FROM debian:bookworm-slim
LABEL author="DevOps Team at Sparked Host" maintainer="devops@sparkedhost.com"
RUN apt-get update -y \
&& apt-get install fontconfig iproute2 curl ca-certificates unzip tar jq -y \
&& useradd -d /home/container -m container \
&& mkdir -p /opt/java
# Download pre-built Temurin JRE binaries
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
# 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"]