Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
abb967f0c3 | ||
|
|
ffac47cb44 |
@@ -1,157 +1,108 @@
|
|||||||
<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>tomcat-rad</artifactId>
|
<artifactId>tomcat-rad</artifactId>
|
||||||
<version>${base.version}-tomcat-${tomcat.version}</version>
|
<version>${base.version}-tomcat-${tomcat.version}</version>
|
||||||
<name>Apache Tomcat for Rapid Application Development</name>
|
<name>Apache Tomcat for Rapid Application Development</name>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<base.version>2.3</base.version>
|
<base.version>2.3</base.version>
|
||||||
|
|
||||||
<!-- The release version of the Java Hotswap Docker image -->
|
<!-- The release version of the Java Hotswap Docker image -->
|
||||||
<!-- See: https://git.inteligr8.com/inteligr8/jdk-hotswap-image -->
|
<!-- See: https://bitbucket.org/inteligr8/jdk-hotswap-docker -->
|
||||||
<!-- See: https://repos.inteligr8.com/nexus/service/rest/repository/browse/inteligr8-docker-public/v2/inteligr8/jdk-hotswap/tags/ -->
|
<jdk-hotswap.version>2.0.3-jbr-17.0.14</jdk-hotswap.version>
|
||||||
<jdk-hotswap.version>2.0.3-jbr17</jdk-hotswap.version>
|
|
||||||
|
|
||||||
<!-- The version of Apache Tomcat to serve as the basis of this Docker image -->
|
<namespace.prefix>tomcat-rad</namespace.prefix>
|
||||||
<!-- See: https://tomcat.apache.org/download-10.cgi -->
|
|
||||||
<tomcat.version>10.1.52</tomcat.version>
|
|
||||||
<tomcat.mirror.baseUrl>https://archive.apache.org/dist/tomcat</tomcat.mirror.baseUrl>
|
|
||||||
|
|
||||||
<!-- The Docker image meta-data for pushing the build -->
|
<!-- The version of Apache Tomcat to serve as the basis of this Docker image -->
|
||||||
<image.name>inteligr8/${project.artifactId}</image.name>
|
<!-- See: https://tomcat.apache.org/download-90.cgi -->
|
||||||
<image.tag>${project.version}</image.tag>
|
<tomcat.version>9.0.116</tomcat.version>
|
||||||
<image.registry>docker.inteligr8.com</image.registry>
|
<tomcat.majorVersion>9</tomcat.majorVersion>
|
||||||
|
<tomcat.mirror.baseUrl>https://archive.apache.org/dist/tomcat</tomcat.mirror.baseUrl>
|
||||||
|
|
||||||
<!-- 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.19.0</version>
|
||||||
</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>
|
<build>
|
||||||
<execution>
|
<contextDir>${project.build.directory}/resources</contextDir>
|
||||||
<id>determine-tomcat-major-version</id>
|
</build>
|
||||||
<phase>validate</phase>
|
</image>
|
||||||
<goals>
|
</images>
|
||||||
<goal>replace-property</goal>
|
<buildStrategy>docker</buildStrategy>
|
||||||
</goals>
|
<verbose>true</verbose>
|
||||||
<configuration>
|
</configuration>
|
||||||
<property>tomcat.version</property>
|
<executions>
|
||||||
<newProperty>tomcat.majorVersion</newProperty>
|
<!-- This execution builds the Docker image -->
|
||||||
<regexes>
|
<execution>
|
||||||
<regex>
|
<id>docker-build</id>
|
||||||
<pattern>([^.]+).*</pattern>
|
<phase>package</phase>
|
||||||
<replacement>$1</replacement>
|
<goals><goal>build</goal></goals>
|
||||||
</regex>
|
</execution>
|
||||||
</regexes>
|
<!-- This execution pushes the built Docker image to the configured Docker Registry -->
|
||||||
</configuration>
|
<execution>
|
||||||
</execution>
|
<id>docker-push</id>
|
||||||
</executions>
|
<phase>deploy</phase>
|
||||||
</plugin>
|
<goals><goal>push</goal></goals>
|
||||||
<plugin>
|
</execution>
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
</executions>
|
||||||
<executions>
|
</plugin>
|
||||||
<execution>
|
<!-- This plugin prevents the project from deploying to the Maven Repository, as it is pointless -->
|
||||||
<id>copy-resources</id>
|
<plugin>
|
||||||
<phase>process-resources</phase>
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
<goals><goal>resources</goal></goals>
|
<version>3.1.4</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<encoding>utf-8</encoding>
|
<skip>true</skip>
|
||||||
<propertiesEncoding>utf-8</propertiesEncoding>
|
</configuration>
|
||||||
</configuration>
|
</plugin>
|
||||||
</execution>
|
</plugins>
|
||||||
</executions>
|
</build>
|
||||||
</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>Containerfile</dockerFile>
|
|
||||||
<tags>
|
|
||||||
<tag>${base.version}-tomcat${tomcat.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>
|
<fabric8.build.jib>true</fabric8.build.jib>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -28,15 +28,26 @@ RUN cd /var/lib/tomcat/dev && \
|
|||||||
mkdir web web-extra1 web-extra2 web-extra3 web-extra4 web-extra5 web-extra6 web-extra7
|
mkdir web web-extra1 web-extra2 web-extra3 web-extra4 web-extra5 web-extra6 web-extra7
|
||||||
|
|
||||||
# Add our Docker container initialization script
|
# Add our Docker container initialization script
|
||||||
ADD --chmod=755 maven/setenv.sh ${CONTAINERD_ENTRYPOINT_PATH}/40-setenv-${artifactId}.sh
|
ADD maven/setenv.sh /usr/local/bin/${namespace.prefix}-setenv.sh
|
||||||
|
COPY maven/docker-entrypoint.sh /usr/local/bin
|
||||||
|
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh
|
||||||
|
|
||||||
# Add our Apache Tomcat configuration
|
# Add our Apache Tomcat configuration
|
||||||
# This gives us dynamic injection points into the running webapps
|
# This gives us dynamic injection points into the running webapps
|
||||||
ADD --chmod=644 maven/tomcat-context.xml /var/lib/tomcat/conf/context.xml
|
COPY maven/tomcat-context.xml /var/lib/tomcat/conf/context.xml
|
||||||
ADD --chmod=644 maven/hotswap-agent.properties /var/lib/tomcat/lib
|
ADD maven/hotswap-agent.properties /var/lib/tomcat/lib
|
||||||
|
|
||||||
# Listening for HTTP (not HTTPS) traffic
|
# Listening for HTTP (not HTTPS) traffic
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
|
# Listening for Java debugger traffic
|
||||||
|
EXPOSE 8000
|
||||||
|
|
||||||
|
# Running as ROOT user for now
|
||||||
|
#USER tomcat
|
||||||
|
|
||||||
|
# Execute the Docker container initialization script
|
||||||
|
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint.sh" ]
|
||||||
|
|
||||||
# Start the Apache Tomcat web container using the Catalina script
|
# Start the Apache Tomcat web container using the Catalina script
|
||||||
CMD [ "/usr/local/share/tomcat/bin/catalina.sh", "run" ]
|
CMD [ "/usr/local/share/tomcat/bin/catalina.sh", "run" ]
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
. /usr/local/bin/jdk-hotswap-setenv.sh
|
||||||
|
. /usr/local/bin/${namespace.prefix}-setenv.sh
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
Reference in New Issue
Block a user