diff --git a/docker/images/cerberus-as-tomcat-keycloak/latest/Dockerfile b/docker/images/cerberus-as-tomcat-keycloak/latest/Dockerfile index 9f9ab6f2f..aac9216e9 100644 --- a/docker/images/cerberus-as-tomcat-keycloak/latest/Dockerfile +++ b/docker/images/cerberus-as-tomcat-keycloak/latest/Dockerfile @@ -1,4 +1,4 @@ -FROM tomcat:8-jre8-alpine +FROM tomcat:9-jre11-temurin ENV LOG_ROOT_PATH /usr/local/tomcat/logs/ @@ -6,8 +6,8 @@ ENV KEYCLOACK_REALM Cerberus ENV KEYCLOACK_CLIENT cerberus ENV KEYCLOACK_URL http://192.168.1.1:8080/auth ENV CATALINA_OPTS="-Dorg.cerberus.environment=prd -Dorg.cerberus.authentification=keycloak -Xmx1024m" -ENV KEYCLOACK_VERSION 8.0.2 -ENV KEYCLOACK_TOMCAT8_ADAPTER_NAME keycloak-tomcat-adapter-dist-${KEYCLOACK_VERSION} +ENV KEYCLOACK_VERSION 18.0.1 +ENV KEYCLOACK_TOMCAT8_ADAPTER_NAME keycloak-oidc-tomcat-adapter-${KEYCLOACK_VERSION} ENV DATABASE_HOST cerberus-db-mysql ENV DATABASE_PORT 3306 @@ -19,23 +19,30 @@ 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 and 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/ # Only for debug purpose #RUN ls -al /usr/local/tomcat/lib/ - +# https://github.com/keycloak/keycloak/releases/download/${KEYCLOACK_VERSION}/keycloak-oidc-tomcat-adapter-${KEYCLOACK_VERSION}.zip +# https://downloads.jboss.org/keycloak/${KEYCLOACK_VERSION}/adapters/keycloak-oidc/${KEYCLOACK_TOMCAT8_ADAPTER_NAME}.zip # Download & install KeyCloak adapter to manage authentification with Tomcat -RUN wget -P /tmp/ https://downloads.jboss.org/keycloak/${KEYCLOACK_VERSION}/adapters/keycloak-oidc/${KEYCLOACK_TOMCAT8_ADAPTER_NAME}.zip && \ +RUN wget -P /tmp/ https://github.com/keycloak/keycloak/releases/download/${KEYCLOACK_VERSION}/${KEYCLOACK_TOMCAT8_ADAPTER_NAME}.zip && \ unzip -q -d /usr/local/tomcat/lib/ /tmp/${KEYCLOACK_TOMCAT8_ADAPTER_NAME}.zip && \ echo "Clean temp directory" && \ rm /tmp/* -rf diff --git a/docker/images/cerberus-as-tomcat-keycloak/latest/context.xml b/docker/images/cerberus-as-tomcat-keycloak/latest/context.xml index c2a16a1bb..e7cdc0ece 100644 --- a/docker/images/cerberus-as-tomcat-keycloak/latest/context.xml +++ b/docker/images/cerberus-as-tomcat-keycloak/latest/context.xml @@ -21,6 +21,7 @@ WEB-INF/web.xml + WEB-INF/tomcat-web.xml ${catalina.base}/conf/web.xml @@ -130,8 +130,9 @@ --> +