Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03d37fc28f | ||
|
|
7a1119a870 | ||
|
|
6d2f68bc33 | ||
|
|
031b9209e3 |
+17
-21
@@ -1,40 +1,28 @@
|
|||||||
|
|
||||||
FROM docker.inteligr8.com/inteligr8/base:${base.image.version}
|
FROM ubuntu:${ubuntu.version}
|
||||||
|
|
||||||
# Configure standard JAVA parameters
|
# Configure standard JAVA parameters
|
||||||
ENV JAVA_MEMORY_INIT=128m
|
ENV JAVA_MEMORY_INIT=128m
|
||||||
ENV JAVA_MEMORY_MAX=512m
|
ENV JAVA_MEMORY_MAX=512m
|
||||||
|
ENV JAVA_HOME=/usr/local/lib/jvm/java-openjdk-jbr
|
||||||
|
ENV JRE_HOME=/usr/local/lib/jvm/java-openjdk-jbr
|
||||||
ENV JAVA_OPTS=
|
ENV JAVA_OPTS=
|
||||||
ENV ENABLE_HOTSWAP=true
|
ENV ENABLE_HOTSWAP=true
|
||||||
ENV ENABLE_JDWP=true
|
ENV ENABLE_JDWP=true
|
||||||
ENV DISABLE_HOTSWAP_PLUGINS=
|
ENV DISABLE_HOTSWAP_PLUGINS=
|
||||||
|
|
||||||
# these are effectively immutable; provided to be used by extending images
|
# Install curl & essentials
|
||||||
# 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 && \
|
RUN apt update && \
|
||||||
apt -y install libfreetype6 fontconfig fonts-dejavu ca-certificates-java
|
apt -y install curl libfreetype6 fontconfig fonts-dejavu
|
||||||
|
|
||||||
# Download & Install JBR Java
|
# Download & Install JBR Java
|
||||||
RUN mkdir -p /usr/local/lib/jvm && \
|
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 && \
|
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 && \
|
tar xzvf java-openjdk-jbr.tar.gz && \
|
||||||
mv ${jbr.basename} java-openjdk-jbr && \
|
mv ${jbr.basename} java-openjdk-jbr && \
|
||||||
mkdir -p java-openjdk-jbr/lib/hotswap && \
|
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 update-ca-certificates && \
|
|
||||||
cd /usr/local/lib/jvm/java-openjdk-jbr/lib/security && \
|
|
||||||
rm cacerts && \
|
|
||||||
ln -s /etc/ssl/certs/java/cacerts .
|
|
||||||
|
|
||||||
# Download Hotswap Agent
|
# Download Hotswap Agent
|
||||||
RUN curl -L https://github.com/HotswapProjects/HotswapAgent/releases/download/RELEASE-${hotswap.version}/hotswap-agent-${hotswap.version}.jar -o /usr/local/lib/jvm/java-openjdk-jbr/lib/hotswap/hotswap-agent.jar
|
RUN curl -L https://github.com/HotswapProjects/HotswapAgent/releases/download/RELEASE-${hotswap.version}/hotswap-agent-${hotswap.version}.jar -o /usr/local/lib/jvm/java-openjdk-jbr/lib/hotswap/hotswap-agent.jar
|
||||||
@@ -46,10 +34,18 @@ 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
|
mkdir lib lib-extra1 lib-extra2 lib-extra3 lib-extra4 lib-extra5 lib-extra6 lib-extra7
|
||||||
|
|
||||||
# Add our Docker container initialization scripts
|
# Add our Docker container initialization scripts
|
||||||
ADD --chmod=755 maven/setenv.sh ${CONTAINERD_ENTRYPOINT_PATH}/10-setenv-${artifactId}.sh
|
ADD maven/target/resources/setenv.sh /usr/local/bin/${namespace.prefix}-setenv.sh
|
||||||
|
ADD maven/target/resources/docker-entrypoint.sh /usr/local/bin
|
||||||
|
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh
|
||||||
|
|
||||||
# Add our default hotswap configuration; may be overwritten in dev/classes* volumes
|
# Add our default hotswap configuration; may be overwritten in dev/classes* volumes
|
||||||
ADD --chmod=644 maven/hotswap-agent.properties /var/lib/jvm/lib
|
ADD maven/target/resources/hotswap-agent.properties /var/lib/jvm/lib
|
||||||
|
|
||||||
# Listening for Java debugger traffic
|
# Listening for Java debugger traffic
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
|
# Running as ROOT user for now
|
||||||
|
#USER java
|
||||||
|
|
||||||
|
# Execute the Docker container initialization script
|
||||||
|
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint.sh" ]
|
||||||
@@ -1,160 +1,110 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.inteligr8</groupId>
|
<groupId>com.inteligr8</groupId>
|
||||||
<artifactId>jdk-hotswap</artifactId>
|
<artifactId>jdk-hotswap</artifactId>
|
||||||
<version>${hotswap.version}-jbr-${jbr.version}</version>
|
<version>${hotswap.version}-jbr-${jbr.version}</version>
|
||||||
<name>Java Hotswap Kit for Rapid Application Development</name>
|
<name>Java Hotswap Kit for Rapid Application Development</name>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<!-- See: https://git.inteligr8.com/inteligr8/base-image -->
|
<!-- The release version of Ubuntu to use as the base -->
|
||||||
<!-- See: https://repos.inteligr8.com/nexus/service/rest/repository/browse/inteligr8-docker-public/v2/inteligr8/base/tags/ -->
|
<!-- See: https://hub.docker.com/_/ubuntu -->
|
||||||
<base.image.version>1.0-deb12</base.image.version>
|
<!-- This has very little impact and may be replaced -->
|
||||||
|
<ubuntu.version>25.04</ubuntu.version>
|
||||||
|
|
||||||
<!-- The version of the Hotswap Agent to use -->
|
<namespace.prefix>${project.artifactId}</namespace.prefix>
|
||||||
<!-- See: https://github.com/HotswapProjects/HotswapAgent/releases -->
|
|
||||||
<hotswap.version>2.0.3</hotswap.version>
|
|
||||||
|
|
||||||
<!-- The version of the JetBrains JDK -->
|
<!-- The version of the Hotswap Agent to use -->
|
||||||
<!-- See: https://github.com/JetBrains/JetBrainsRuntime/releases -->
|
<!-- See: https://github.com/HotswapProjects/HotswapAgent/releases -->
|
||||||
<jbr.version>21.0.11</jbr.version>
|
<hotswap.version>2.0.3</hotswap.version>
|
||||||
<jbr.buildNumber>1163.116</jbr.buildNumber>
|
|
||||||
<jbr.basename>jbr_jcef-${jbr.version}-linux-x64-b${jbr.buildNumber}</jbr.basename>
|
|
||||||
<jbr.filename>${jbr.basename}.tar.gz</jbr.filename>
|
|
||||||
|
|
||||||
<!-- The Docker image meta-data for pushing the build -->
|
<!-- The version of the JetBrains JDK -->
|
||||||
<image.name>inteligr8/${project.artifactId}</image.name>
|
<!-- See: https://github.com/JetBrains/JetBrainsRuntime/releases -->
|
||||||
<image.tag>${project.version}</image.tag>
|
<jbr.version>21.0.10</jbr.version>
|
||||||
<image.registry>docker.inteligr8.com</image.registry>
|
<jbr.buildNumber>1163.110</jbr.buildNumber>
|
||||||
|
<jbr.basename>jbr_jcef-${jbr.version}-linux-x64-b${jbr.buildNumber}</jbr.basename>
|
||||||
|
<jbr.filename>${jbr.basename}.tar.gz</jbr.filename>
|
||||||
|
|
||||||
<!-- using version properties so they can be overridden by child projects or Maven executions -->
|
<!-- The Docker image meta-data for pushing the build -->
|
||||||
<maven-resources-plugin.version>3.5.0</maven-resources-plugin.version>
|
<image.name>inteligr8/${project.artifactId}</image.name>
|
||||||
<maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>
|
<image.tag>${project.version}</image.tag>
|
||||||
<kubernetes-maven-plugin.version>1.19.0</kubernetes-maven-plugin.version>
|
<image.registry>docker.inteligr8.com</image.registry>
|
||||||
<regex-maven-plugin.version>1.0.7</regex-maven-plugin.version>
|
</properties>
|
||||||
</properties>
|
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
<directory>src/main/containerd</directory>
|
<directory>src/main/docker</directory>
|
||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
<targetPath>${project.build.directory}/resources</targetPath>
|
<targetPath>${project.build.directory}/resources</targetPath>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
<pluginManagement>
|
<plugins>
|
||||||
<plugins>
|
<plugin>
|
||||||
<plugin>
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
<version>3.5.0</version>
|
||||||
<version>${maven-resources-plugin.version}</version>
|
<executions>
|
||||||
</plugin>
|
<execution>
|
||||||
<plugin>
|
<id>copy-resources</id>
|
||||||
<artifactId>maven-deploy-plugin</artifactId>
|
<phase>process-resources</phase>
|
||||||
<version>${maven-deploy-plugin.version}</version>
|
<goals><goal>resources</goal></goals>
|
||||||
</plugin>
|
<configuration>
|
||||||
<plugin>
|
<encoding>utf-8</encoding>
|
||||||
<groupId>org.eclipse.jkube</groupId>
|
<propertiesEncoding>utf-8</propertiesEncoding>
|
||||||
<artifactId>kubernetes-maven-plugin</artifactId>
|
</configuration>
|
||||||
<version>${kubernetes-maven-plugin.version}</version>
|
</execution>
|
||||||
</plugin>
|
</executions>
|
||||||
<plugin>
|
</plugin>
|
||||||
<groupId>com.inteligr8</groupId>
|
<!-- This plugin build and pushes the Docker image -->
|
||||||
<artifactId>regex-maven-plugin</artifactId>
|
<plugin>
|
||||||
<version>${regex-maven-plugin.version}</version>
|
<groupId>org.eclipse.jkube</groupId>
|
||||||
</plugin>
|
<artifactId>kubernetes-maven-plugin</artifactId>
|
||||||
</plugins>
|
<version>1.16.2</version> <!-- later versions isn't working; investigate -->
|
||||||
</pluginManagement>
|
<configuration>
|
||||||
<plugins>
|
<images>
|
||||||
<plugin>
|
<image>
|
||||||
<groupId>com.inteligr8</groupId>
|
<name>${image.name}:${image.tag}</name>
|
||||||
<artifactId>regex-maven-plugin</artifactId>
|
<registry>${image.registry}</registry>
|
||||||
<executions>
|
</image>
|
||||||
<execution>
|
</images>
|
||||||
<id>determine-jbr-major-version</id>
|
<contextDir>${project.build.directory}/resources</contextDir>
|
||||||
<phase>validate</phase>
|
<dockerFile>${project.basedir}/Dockerfile</dockerFile>
|
||||||
<goals>
|
<verbose>true</verbose>
|
||||||
<goal>replace-property</goal>
|
</configuration>
|
||||||
</goals>
|
<executions>
|
||||||
<configuration>
|
<!-- This execution builds the Docker image -->
|
||||||
<property>jbr.version</property>
|
<execution>
|
||||||
<newProperty>jbr.majorVersion</newProperty>
|
<id>docker-build</id>
|
||||||
<regexes>
|
<phase>package</phase>
|
||||||
<regex>
|
<goals><goal>build</goal></goals>
|
||||||
<pattern>([^.]+).*</pattern>
|
</execution>
|
||||||
<replacement>$1</replacement>
|
<!-- This execution pushes the built Docker image to the configured Docker Registry -->
|
||||||
</regex>
|
<execution>
|
||||||
</regexes>
|
<id>docker-push</id>
|
||||||
</configuration>
|
<phase>deploy</phase>
|
||||||
</execution>
|
<goals><goal>push</goal></goals>
|
||||||
</executions>
|
</execution>
|
||||||
</plugin>
|
</executions>
|
||||||
<plugin>
|
</plugin>
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
<!-- This plugin prevents the project from deploying to the Maven Repository, as it is pointless -->
|
||||||
<executions>
|
<plugin>
|
||||||
<execution>
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
<id>copy-resources</id>
|
<version>3.1.4</version>
|
||||||
<phase>process-resources</phase>
|
<configuration>
|
||||||
<goals><goal>resources</goal></goals>
|
<skip>true</skip>
|
||||||
<configuration>
|
</configuration>
|
||||||
<encoding>utf-8</encoding>
|
</plugin>
|
||||||
<propertiesEncoding>utf-8</propertiesEncoding>
|
</plugins>
|
||||||
</configuration>
|
</build>
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<!-- This plugin build and pushes the Docker image -->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.eclipse.jkube</groupId>
|
|
||||||
<artifactId>kubernetes-maven-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<images>
|
|
||||||
<image>
|
|
||||||
<name>${image.name}:${image.tag}</name>
|
|
||||||
<registry>${image.registry}</registry>
|
|
||||||
<build>
|
|
||||||
<contextDir>${project.build.directory}/resources</contextDir>
|
|
||||||
<dockerFile>${project.basedir}/Containerfile</dockerFile>
|
|
||||||
<tags>
|
|
||||||
<tag>${hotswap.version}-jbr${jbr.majorVersion}</tag>
|
|
||||||
</tags>
|
|
||||||
</build>
|
|
||||||
</image>
|
|
||||||
</images>
|
|
||||||
<verbose>true</verbose>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<!-- This execution builds the Docker image -->
|
|
||||||
<execution>
|
|
||||||
<id>docker-build</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals><goal>build</goal></goals>
|
|
||||||
</execution>
|
|
||||||
<!-- This execution pushes the built Docker image to the configured Docker Registry -->
|
|
||||||
<execution>
|
|
||||||
<id>docker-push</id>
|
|
||||||
<phase>deploy</phase>
|
|
||||||
<goals><goal>push</goal></goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<!-- This plugin prevents the project from deploying to the Maven Repository, as it is pointless -->
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-deploy-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<skip>true</skip>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
<id>no-docker</id>
|
<id>no-docker</id>
|
||||||
<properties>
|
<properties>
|
||||||
<jkube.build.strategy>jib</jkube.build.strategy>
|
<jkube.build.strategy>jib</jkube.build.strategy>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
. /usr/local/bin/${namespace.prefix}-setenv.sh
|
||||||
|
|
||||||
|
JAVA_CP="/var/lib/jvm/lib:/var/lib/jvm/lib/*"
|
||||||
|
JAVA_CP="${JAVA_CP}:/var/lib/jvm/dev/classes:/var/lib/jvm/dev/classes-extra1:/var/lib/jvm/dev/classes-extra2:/var/lib/jvm/dev/classes-extra3:/var/lib/jvm/dev/classes-extra4:/var/lib/jvm/dev/classes-extra5:/var/lib/jvm/dev/classes-extra6:/var/lib/jvm/dev/classes-extra7"
|
||||||
|
JAVA_CP="${JAVA_CP}:/var/lib/jvm/dev/lib/*:/var/lib/jvm/dev/lib-extra1/*:/var/lib/jvm/dev/lib-extra2/*:/var/lib/jvm/dev/lib-extra3/*:/var/lib/jvm/dev/lib-extra4/*:/var/lib/jvm/dev/lib-extra5/*:/var/lib/jvm/dev/lib-extra6/*:/var/lib/jvm/dev/lib-extra7/*"
|
||||||
|
EXEC_JAVA_OPTS="${JAVA_OPTS} -classpath ${JAVA_CP}"
|
||||||
|
|
||||||
|
exec ${JAVA_HOME}/bin/java ${EXEC_JAVA_OPTS} ${JAVA_CLASS}
|
||||||
@@ -1,8 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/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}"
|
JAVA_OPTS="${JAVA_OPTS} -Xms${JAVA_MEMORY_INIT} -Xmx${JAVA_MEMORY_MAX}"
|
||||||
|
|
||||||
if [ "${ENABLE_HOTSWAP}" = "true" ]; then
|
if [ "${ENABLE_HOTSWAP}" = "true" ]; then
|
||||||
Reference in New Issue
Block a user