refactored to use base image

This commit is contained in:
2026-05-21 20:01:29 -04:00
parent 88cd66eed9
commit 712a1d5e1e
4 changed files with 66 additions and 40 deletions
+18 -21
View File
@@ -1,5 +1,5 @@
FROM debian:${debian.version}-slim
FROM docker.inteligr8.com/inteligr8/base:${base.image.version}
# Configure standard JAVA parameters
ENV JAVA_MEMORY_INIT=128m
@@ -8,28 +8,31 @@ ENV JAVA_OPTS=
ENV ENABLE_HOTSWAP=true
ENV ENABLE_JDWP=true
ENV DISABLE_HOTSWAP_PLUGINS=
ENV CACERT_INSTALL_PATH=/usr/local/share/ca-certificates
# Install curl & essentials
# these are effectively immutable; provided to be used by extending images
# the entrypoint will re-set these in case they are changed
ENV JAVA_HOME=/usr/local/lib/jvm/java-openjdk-jbr
ENV JRE_HOME=/usr/local/lib/jvm/java-openjdk-jbr
# Install essentials for Java
RUN apt update && \
apt -y install curl libfreetype6 fontconfig fonts-dejavu
apt -y install libfreetype6 fontconfig fonts-dejavu ca-certificates-java
# Download & Install JBR Java
RUN mkdir -p /usr/local/lib/jvm && \
curl -L https://cache-redirector.jetbrains.com/intellij-jbr/${jbr.filename} -o /usr/local/lib/jvm/java-openjdk-jbr.tar.gz && \
cd /usr/local/lib/jvm && \
curl -L https://cache-redirector.jetbrains.com/intellij-jbr/${jbr.filename} -o java-openjdk-jbr.tar.gz && \
tar xzvf java-openjdk-jbr.tar.gz && \
mv ${jbr.basename} java-openjdk-jbr && \
mkdir -p java-openjdk-jbr/lib/hotswap && \
rm java-openjdk-jbr.tar.gz
rm java-openjdk-jbr.tar.gz && \
cd ../../bin && \
ln -s ../lib/jvm/java-openjdk-jbr/bin/java . && \
ln -s ../lib/jvm/java-openjdk-jbr/bin/keytool
# Configure `cacerts`
RUN apt -y install ca-certificates-java && \
cd /usr/local/bin && \
ln -s ../lib/jvm/java-openjdk-jbr/bin/java . && \
ln -s ../lib/jvm/java-openjdk-jbr/bin/keytool . && \
update-ca-certificates && \
cd ../lib/jvm/java-openjdk-jbr/lib/security && \
RUN update-ca-certificates && \
cd /usr/local/lib/jvm/java-openjdk-jbr/lib/security && \
rm cacerts && \
ln -s /etc/ssl/certs/java/cacerts .
@@ -43,18 +46,12 @@ RUN mkdir -p /var/lib/jvm && cd /var/lib/jvm && \
mkdir lib lib-extra1 lib-extra2 lib-extra3 lib-extra4 lib-extra5 lib-extra6 lib-extra7
# Add our Docker container initialization scripts
ADD maven/setenv.sh /usr/local/bin/${namespace.prefix}-setenv.sh
ADD maven/containerd-entrypoint.sh /usr/local/bin
RUN chmod 755 /usr/local/bin/containerd-entrypoint.sh
ADD --chmod=755 maven/setenv.sh ${CONTAINERD_ENTRYPOINT_PATH}/10-setenv-${project.artifactId}.sh
# Add our default hotswap configuration; may be overwritten in dev/classes* volumes
ADD maven/hotswap-agent.properties /var/lib/jvm/lib
ADD --chmod 644 maven/hotswap-agent.properties /var/lib/jvm/lib
# Listening for Java debugger traffic
EXPOSE 8000
# Running as ROOT user for now
#USER java
# Execute the Docker container initialization script
ENTRYPOINT [ "/usr/local/bin/containerd-entrypoint.sh" ]
CMD [ "${JAVA_HOME}/bin/java" ]
+46 -8
View File
@@ -8,11 +8,9 @@
<packaging>pom</packaging>
<properties>
<!-- The release version of Debian Linux to use as the base -->
<!-- See: https://hub.docker.com/_/debian -->
<debian.version>12.14</debian.version>
<namespace.prefix>${project.artifactId}</namespace.prefix>
<!-- See: https://git.inteligr8.com/inteligr8/base-image -->
<!-- See: https://repos.inteligr8.com/nexus/service/rest/repository/browse/inteligr8-docker-public/v2/inteligr8/base/tags/ -->
<base.image.version>1.0-deb12</base.image.version>
<!-- The version of the Hotswap Agent to use -->
<!-- See: https://github.com/HotswapProjects/HotswapAgent/releases -->
@@ -21,7 +19,6 @@
<!-- The version of the JetBrains JDK -->
<!-- See: https://github.com/JetBrains/JetBrainsRuntime/releases -->
<jbr.version>17.0.14</jbr.version>
<jbr.majorVersion>17</jbr.majorVersion>
<jbr.buildNumber>1367.22</jbr.buildNumber>
<jbr.basename>jbr_jcef-${jbr.version}-linux-x64-b${jbr.buildNumber}</jbr.basename>
<jbr.filename>${jbr.basename}.tar.gz</jbr.filename>
@@ -30,6 +27,12 @@
<image.name>inteligr8/${project.artifactId}</image.name>
<image.tag>${project.version}</image.tag>
<image.registry>docker.inteligr8.com</image.registry>
<!-- using version properties so they can be overridden by child projects or Maven executions -->
<maven-resources-plugin.version>3.5.0</maven-resources-plugin.version>
<maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>
<kubernetes-maven-plugin.version>1.19.0</kubernetes-maven-plugin.version>
<regex-maven-plugin.version>1.0.7</regex-maven-plugin.version>
</properties>
<build>
@@ -42,14 +45,50 @@
</resources>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>1.19.0</version>
<version>${kubernetes-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.inteligr8</groupId>
<artifactId>regex-maven-plugin</artifactId>
<version>${regex-maven-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.inteligr8</groupId>
<artifactId>regex-maven-plugin</artifactId>
<executions>
<execution>
<id>determine-jbr-major-version</id>
<phase>validate</phase>
<goals>
<goal>replace-property</goal>
</goals>
<configuration>
<property>jbr.version</property>
<newProperty>jbr.majorVersion</newProperty>
<regexes>
<regex>
<pattern>([^.]+).*</pattern>
<replacement>$1</replacement>
</regex>
</regexes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
@@ -68,7 +107,6 @@
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>1.19.0</version>
<configuration>
<images>
<image>
@@ -1,11 +0,0 @@
#!/bin/sh
. /usr/local/bin/${namespace.prefix}-setenv.sh
# update cacerts with any custom certs in /usr/local/share/ca-certificates
update-ca-certificates
if [ -z $1 ]; then
exec /bin/bash
else
exec ${JAVA_HOME}/bin/java $@
fi
+2
View File
@@ -1,4 +1,6 @@
#!/bin/sh
# immutable
JAVA_HOME=/usr/local/lib/jvm/java-openjdk-jbr
JRE_HOME=/usr/local/lib/jvm/java-openjdk-jbr
JAVA_OPTS="${JAVA_OPTS} -Xms${JAVA_MEMORY_INIT} -Xmx${JAVA_MEMORY_MAX}"