diff --git a/10/mysql-tomcat/Dockerfile b/10/mysql-tomcat/Dockerfile
index b94362b3415ec6885047cda8178f8f461a730027..82c4f0b8757ca60277de50c6e22840e4b14af3fa 100644
--- a/10/mysql-tomcat/Dockerfile
+++ b/10/mysql-tomcat/Dockerfile
@@ -17,7 +17,7 @@
 # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 # ---------------------------------------------------------------------------
-FROM tomcat:8-jdk11-adoptopenjdk-hotspot
+FROM tomcat:8-jdk8-adoptopenjdk-hotspot
 
 #    ____  ____  ____      ____  _   __        _
 #   |_  _||_  _||_  _|    |_  _|(_) [  |  _   (_)
diff --git a/10/postgres-tomcat/Dockerfile b/10/postgres-tomcat/Dockerfile
index 97141046a6722ff7069443a65cf1c507ac715dac..bdc256727e368c7d0f734565c9c3adee02273490 100644
--- a/10/postgres-tomcat/Dockerfile
+++ b/10/postgres-tomcat/Dockerfile
@@ -17,7 +17,7 @@
 # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 # ---------------------------------------------------------------------------
-FROM tomcat:8-jdk11-adoptopenjdk-hotspot
+FROM tomcat:8-jdk8-adoptopenjdk-hotspot
 
 #    ____  ____  ____      ____  _   __        _
 #   |_  _||_  _||_  _|    |_  _|(_) [  |  _   (_)
diff --git a/template/Dockerfile b/template/Dockerfile
index 8964064e56d28b08c7ed19d03f5ff2b81e30dc61..1a7546e447c521f043dceb062a08f6a842847fa6 100644
--- a/template/Dockerfile
+++ b/template/Dockerfile
@@ -17,7 +17,11 @@
 # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 # ---------------------------------------------------------------------------
-FROM tomcat:8-jdk11-adoptopenjdk-hotspot
+<% if (xwikiVersion.startsWith('10.'))
+     print 'FROM tomcat:8-jdk8-adoptopenjdk-hotspot'
+   else
+     print 'FROM tomcat:8-jdk11-adoptopenjdk-hotspot'
+%>
 
 #    ____  ____  ____      ____  _   __        _
 #   |_  _||_  _||_  _|    |_  _|(_) [  |  _   (_)
diff --git a/template/xwiki/docker-entrypoint.sh b/template/xwiki/docker-entrypoint.sh
index 4c769e3777d5c956f4ad51ecfc8a9a7dfc5f268e..f158119805f151e9e732b4aba91aa0c88564737e 100755
--- a/template/xwiki/docker-entrypoint.sh
+++ b/template/xwiki/docker-entrypoint.sh
@@ -120,6 +120,7 @@ function configure() {
   safesed "replacepassword" \$DB_PASSWORD /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
   safesed "replacecontainer" \$DB_HOST /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
   safesed "replacedatabase" \$DB_DATABASE /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
+
   echo '  Generating authentication validation and encryption keys...'
   xwiki_set_cfg 'xwiki.authentication.validationKey' "\$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
   xwiki_set_cfg 'xwiki.authentication.encryptionKey' "\$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"