-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
34 lines (24 loc) · 1.33 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
34
# ----------------------------------
# Sparked Host Custom Docker Image
# Image: ghcr.io/sparkedhost/images:java-jre8
# ----------------------------------
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/temurin8-binaries/releases/download/jdk8u402-b06/OpenJDK8U-jre_x64_linux_hotspot_8u402b06.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"]