Skip to content

Commit

Permalink
Merge pull request #202 from mcneilco/735-apache-tomcat-upgrade
Browse files Browse the repository at this point in the history
fixes #735 apache tomcat upgrade to patch vulnerabilities
  • Loading branch information
brianbolt committed Mar 16, 2021
2 parents 00125eb + 422fb9b commit 0497c07
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 54 deletions.
43 changes: 28 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
FROM mcneilco/tomcat-maven:openjdk8
ARG CHEMISTRY_PACKAGE=jchem
ARG TOMCAT_IMAGE=mcneilco/tomcat-maven:1.3-openjdk8

FROM ${TOMCAT_IMAGE} as dependencies
ARG CHEMISTRY_PACKAGE
ENV CHEMISTRY_PACKAGE=${CHEMISTRY_PACKAGE}

FROM dependencies as jchem
ADD lib/jchem-16.4.25.0.jar /lib/jchem-16.4.25.0.jar
RUN mvn install:install-file -Dfile=/lib/jchem-16.4.25.0.jar -DartifactId=jchem -DgroupId=com.chemaxon -Dversion=16.4.25.0 -Dpackaging=jar -DgeneratePom=true -DcreateChecksum=true

FROM dependencies as indigo

FROM ${CHEMISTRY_PACKAGE} as compile
WORKDIR /src
ENV CATALINA_HOME /usr/local/tomcat
ENV PATH $CATALINA_HOME/bin:$PATH
ADD pom.xml /src/pom.xml
ADD lib/jchem-16.4.25.0.jar /lib/jchem-16.4.25.0.jar
RUN ["mvn", "install:install-file","-Dfile=/lib/jchem-16.4.25.0.jar","-DartifactId=jchem","-DgroupId=com.chemaxon","-Dversion=16.4.25.0","-Dpackaging=jar","-DgeneratePom=true","-DcreateChecksum=true"]
RUN ["mvn", "dependency:resolve", "-P", "default"]
RUN ["mvn", "clean"]
ADD . /src
RUN mvn compile war:war -P default
RUN mv target/acas*.war $CATALINA_HOME/webapps/acas.war
RUN mv target/acas* $CATALINA_HOME/webapps/acas
RUN rm -rf /src
WORKDIR $CATALINA_HOME
EXPOSE 8080
CMD ["catalina.sh", "run"]
RUN mvn dependency:resolve-plugins
RUN mvn dependency:resolve -P ${CHEMISTRY_PACKAGE}
ADD . /src
RUN mvn clean && \
mvn compile war:war -P ${CHEMISTRY_PACKAGE} && \
mv target/acas*.war $CATALINA_HOME/webapps/acas.war && \
mv target/acas* $CATALINA_HOME/webapps/acas

FROM ${TOMCAT_IMAGE} as build
COPY --from=compile /src/target/acas*.war $CATALINA_HOME/webapps/acas/ $CATALINA_HOME/webapps/acas.war
COPY --from=compile /src/target/acas* $CATALINA_HOME/webapps/acas/ $CATALINA_HOME/webapps/acas
WORKDIR $CATALINA_HOME
EXPOSE 8080
CMD ["catalina.sh", "run"]
15 changes: 0 additions & 15 deletions Dockerfile-indigo

This file was deleted.

35 changes: 11 additions & 24 deletions pom.xml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -58,56 +58,43 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.]]>
<repository>
<id>spring-maven-release</id>
<name>Spring Maven Release Repository</name>
<url>http://maven.springframework.org/release</url>
<url>https://maven.springframework.org/release</url>
</repository>
<repository>
<id>spring-maven-milestone</id>
<name>Spring Maven Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
<url>https://maven.springframework.org/milestone</url>
</repository>
<repository>
<id>spring-roo-repository</id>
<name>Spring Roo Repository</name>
<url>http://spring-roo-repository.springsource.org/release</url>
</repository>
<repository>
<id>jcenter-release</id>
<name>jcenter</name>
<url>http://oss.jfrog.org/artifactory/oss-release-local/</url>
</repository>
<repository>
<id>OSGEO GeoTools repo</id>
<url>http://download.osgeo.org/webdav/geotools</url>
</repository>
<repository>
<id>codehaus</id>
<url>https://repository.codehaus.org/org/codehaus</url>
<url>https://spring-roo-repository.springsource.org/release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-maven-release</id>
<name>Spring Maven Release Repository</name>
<url>http://maven.springframework.org/release</url>
<url>https://maven.springframework.org/release</url>
</pluginRepository>
<pluginRepository>
<id>spring-maven-milestone</id>
<name>Spring Maven Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
<url>https://maven.springframework.org/milestone</url>
</pluginRepository>
<pluginRepository>
<id>spring-roo-repository</id>
<name>Spring Roo Repository</name>
<url>http://spring-roo-repository.springsource.org/release</url>
<url>https://spring-roo-repository.springsource.org/release</url>
</pluginRepository>
</pluginRepositories>
<!-- Maven Build profile controls whether to use JChem or Indigo -->
<profiles>
<profile>
<id>default</id>
<id>jchem</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</activation>
<dependencies>
<dependency>
<groupId>com.chemaxon</groupId>
Expand Down Expand Up @@ -312,7 +299,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.]]>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
Expand Down Expand Up @@ -640,9 +627,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.]]>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<groupId>com.nickwongdev</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.9</version>
<version>1.12.1</version>
<!-- NB: do not use 1.3 or 1.3.x due to MASPECTJ-90 and do not use 1.4
due to declare parents issue -->
<dependencies>
Expand Down

0 comments on commit 0497c07

Please sign in to comment.