Skip to content

Commit

Permalink
Fixed Snapshot docker version.
Browse files Browse the repository at this point in the history
  • Loading branch information
vertigo17 committed Jan 25, 2025
1 parent d67cc18 commit f743db5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
24 changes: 16 additions & 8 deletions docker/images/cerberus-as-tomcat/SNAPSHOT/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM tomcat:8-jre8-alpine
FROM tomcat:9-jre11-temurin

ENV LOG_ROOT_PATH /usr/local/tomcat/logs/

Expand All @@ -10,18 +10,24 @@ ENV DATABASE_NAME cerberus
ENV DATABASE_USER cerberus
ENV DATABASE_PASSWORD toto

ARG CERBERUS_NAME=Cerberus
ARG CERBERUS_VERSION=SNAPSHOT
ARG CERBERUS_NAME=cerberus-core
ARG CERBERUS_VERSION=4.18
ARG CERBERUS_PACKAGE_NAME=${CERBERUS_NAME}-${CERBERUS_VERSION}

ARG MYSQL_JAVA_CONNECTOR_VERSION=5.1.47
ARG MYSQL_JAVA_CONNECTOR_NAME=mysql-connector-java-${MYSQL_JAVA_CONNECTOR_VERSION}
ARG MYSQL_JAVA_CONNECTOR_VERSION=9.0.0
ARG MYSQL_JAVA_CONNECTOR_NAME=mysql-connector-j-${MYSQL_JAVA_CONNECTOR_VERSION}


RUN apt-get update -qqy \
&& apt-get -qqy install \
unzip dos2unix \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

# Download & install MySQL JDBC Drivers
RUN echo "Download & install MySQL JDBC Drivers" && \
wget -P /tmp/ https://downloads.mysql.com/archives/get/p/3/file/${MYSQL_JAVA_CONNECTOR_NAME}.zip && \
unzip -q -d /tmp/ /tmp/${MYSQL_JAVA_CONNECTOR_NAME}.zip && \
mv /tmp/${MYSQL_JAVA_CONNECTOR_NAME}/${MYSQL_JAVA_CONNECTOR_NAME}-bin.jar /usr/local/tomcat/lib/ && \
mv /tmp/${MYSQL_JAVA_CONNECTOR_NAME}/${MYSQL_JAVA_CONNECTOR_NAME}.jar /usr/local/tomcat/lib/ && \
echo "Clean temp directory" && \
rm /tmp/* -rf
#COPY mysql-connector-java-5.1.20-bin.jar /usr/local/tomcat/lib/
Expand All @@ -31,11 +37,13 @@ RUN echo "Download & install MySQL JDBC Drivers" && \

# Download & install Cerberus Application
RUN echo "Download & install Cerberus Application" && \
wget -P /tmp/ https://vm.cerberus-testing.org/delivery/Cerberus-${CERBERUS_VERSION}.war && \
wget -P /tmp/ https://github.com/cerberustesting/cerberus-source/releases/download/cerberus-testing-${CERBERUS_VERSION}/cerberus-core-${CERBERUS_VERSION}.zip && \
unzip -q -d /tmp /tmp/${CERBERUS_PACKAGE_NAME}.zip && \
rm -rf /usr/local/tomcat/webapps/* && \
cp /tmp/Cerberus-${CERBERUS_VERSION}.war /usr/local/tomcat/webapps/ROOT.war && \
cp /tmp/${CERBERUS_PACKAGE_NAME}/${CERBERUS_PACKAGE_NAME}.war /usr/local/tomcat/webapps/ROOT.war && \
echo "Clean temp directory" && \
rm /tmp/* -rf
#COPY Cerberus-3.12-SNAPSHOT.war /usr/local/tomcat/webapps/ROOT.war

# Only for debug purpose
#RUN ls -al /usr/local/tomcat/webapps/
Expand Down
1 change: 1 addition & 0 deletions docker/images/cerberus-as-tomcat/SNAPSHOT/context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>


Expand Down
13 changes: 7 additions & 6 deletions docker/images/cerberus-as-tomcat/SNAPSHOT/server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
testWhileIdle="true"
username="${DATABASE_USER}"
password="${DATABASE_PASSWORD}"
driverClassName="com.mysql.jdbc.Driver"
driverClassName="com.mysql.cj.jdbc.Driver"
url="jdbc:mysql://${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}"/>


Expand Down Expand Up @@ -85,7 +85,7 @@
-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
redirectPort="8443" maxSavePostSize ="2097152"/>
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
Expand Down Expand Up @@ -130,8 +130,9 @@
-->

<!-- Define an AJP 1.3 Connector on port 8009 -->
<!--
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

-->

<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
Expand All @@ -155,13 +156,13 @@
via a brute-force attack -->

<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="com.mysql.jdbc.Driver"
driverName="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}?user=${DATABASE_USER}&amp;password=${DATABASE_PASSWORD}"
userTable="user"
userNameCol="Login"
userCredCol="Password"
userRoleTable="usergroup"
roleNameCol="GroupName">
userRoleTable="userrole"
roleNameCol="Role">
<CredentialHandler className="org.apache.catalina.realm.MessageDigestCredentialHandler" algorithm="SHA-1" />
</Realm>

Expand Down

0 comments on commit f743db5

Please sign in to comment.