New EclipseLik build image 2.0.0 with MySQL 8 (#1476)

This PR contains new Maven project to build and publish Docker image used in various build environments.
Released image 2.0.0 is applied in Jenkins pipelines.
It contains upgrade into MySQL 8.0 DB plus related changes (JDBC driver/class name and some JDBC URL properties).

Signed-off-by: Tomas Kraus <tomas.kraus@oracle.com>
Co-authored-by: Radek Felcman <radek.felcman@oracle.com>
diff --git a/.gitignore b/.gitignore
index 299e2af..93dbfa5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@
 .idea/
 test_*.properties
 .sonar
+*~
diff --git a/etc/el-test.mysql.properties b/etc/el-test.mysql.properties
index 44ee1b8..4b0b16f 100644
--- a/etc/el-test.mysql.properties
+++ b/etc/el-test.mysql.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2020, 2022 Oracle and/or its affiliates. All rights reserved.
 #
 # This program and the accompanying materials are made available under the
 # terms of the Eclipse Public License v. 2.0 which is available at
@@ -11,14 +11,16 @@
 #
 
 # DB Connection properties
-db.driver=com.mysql.jdbc.Driver
-db.xa.driver=com.mysql.jdbc.Driver
+db.driver=com.mysql.cj.jdbc.Driver
+db.xa.driver=com.mysql.cj.jdbc.Driver
 #db.xa.driver=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
-db.url=jdbc:mysql://localhost:3306/ecltests?useSSL=false
+db.url=jdbc:mysql://localhost:3306/ecltests?allowPublicKeyRetrieval=true
+db.root.pwd=root
 db.user=root
 db.pwd=root
 db.platform=org.eclipse.persistence.platform.database.MySQLPlatform
-db.properties=url=jdbc:mysql://localhost:3306/ecltests;useSSL=false
+# Used in JEE server side tests to setup datasource by Maven Cargo plugin
+db.properties=url=jdbc:mysql://localhost:3306/ecltests?allowPublicKeyRetrieval=true
 #db.ddl.debug=true
 datasource.type=java.sql.Driver
 #datasource.type=javax.sql.XADataSource
diff --git a/etc/jenkins/build.groovy b/etc/jenkins/build.groovy
index 57f3ffe..ddd57b4 100644
--- a/etc/jenkins/build.groovy
+++ b/etc/jenkins/build.groovy
@@ -1,5 +1,5 @@
 //
-//  Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
+//  Copyright (c) 2019, 2022 Oracle and/or its affiliates. All rights reserved.
 //
 //  This program and the accompanying materials are made available under the
 //  terms of the Eclipse Public License v. 2.0 which is available at
@@ -75,7 +75,7 @@
       requests:
         memory: "12Gi"
         cpu: "5.5"
-    image: tkraus/el-build:1.1.9
+    image: tkraus/el-build:2.0.0
     volumeMounts:
     - name: tools
       mountPath: /opt/tools
diff --git a/etc/jenkins/docker/image/Dockerfile b/etc/jenkins/docker/image/Dockerfile
new file mode 100644
index 0000000..140689f
--- /dev/null
+++ b/etc/jenkins/docker/image/Dockerfile
@@ -0,0 +1,22 @@
+# Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
+
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0 which is available at
+# http://www.eclipse.org/legal/epl-2.0,
+# or the Eclipse Distribution License v. 1.0 which is available at
+# http://www.eclipse.org/org/documents/edl-v10.php.
+
+# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
+
+# Eclipse Foundation build infrastructure Docker image for EclipseLiunk builds
+FROM ${docker.source}
+
+ADD ${java.pkg} ${ant.pkg} ${maven.pkg} ${install.java}/
+
+ADD mongo-start.sh mongo-stop.sh mysql-start.sh mysql-stop.sh ${install.scripts}/
+
+ADD install.sh ${mysql.pkg} /tmp/
+
+RUN chmod u+x /tmp/install.sh \
+    && /tmp/install.sh > /tmp/install.log 2>&1 \
+    && rm -vf /tmp/install.sh /tmp/${mysql.pkg}
diff --git a/etc/jenkins/docker/image/install.sh b/etc/jenkins/docker/image/install.sh
new file mode 100644
index 0000000..6a7f29c
--- /dev/null
+++ b/etc/jenkins/docker/image/install.sh
@@ -0,0 +1,150 @@
+#!/bin/sh
+#
+# Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
+
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0 which is available at
+# http://www.eclipse.org/legal/epl-2.0,
+# or the Eclipse Distribution License v. 1.0 which is available at
+# http://www.eclipse.org/org/documents/edl-v10.php.
+
+# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
+
+# This script file is processed with Maven resource filtering
+# so variables expansion must be used with respect to defined
+# maven POM properties.
+
+# Docker image installation file
+# Print timestamp and message to sdtout
+# Arguments:
+#   $1 First message to be printed
+#   $2 Second message to be printed
+#   ...
+print() {
+  echo '['`date '+%d.%m.%Y %H:%M:%S'`'] '$@
+}
+
+JENKINS_USER='${build.user.name}'
+JENKINS_UID='${build.user.uid}'
+JENKINS_GROUP='${build.group.name}'
+JENKINS_GID='${build.group.gid}'
+
+INSTALL_JAVA='${install.java}'
+
+print "Adding Jenkins group ${JENKINS_GROUP}:${JENKINS_GID}"
+groupadd -g "${JENKINS_GID}" "${JENKINS_GROUP}"
+
+print "Adding Jenkins user ${JENKINS_USER}:${JENKINS_UID}"
+useradd -u "${JENKINS_UID}"       -g "${JENKINS_GID}" \
+        -s '${build.user.shell}' -c '${build.user.comment}' \
+        -m "${JENKINS_USER}"
+
+print "Updating the system"
+echo '--------------------------------------------------------------------------------'
+yum -y update
+yum -y install git
+echo '--------------------------------------------------------------------------------'
+
+print "Configuring Java tools in ${INSTALL_JAVA}"
+
+JDK_PATH=''
+for i in `ls ${INSTALL_JAVA} | grep 'jdk-'`; do
+  JDK_PATH="${JDK_PATH}:${INSTALL_JAVA}/${i}/bin"
+done
+print " - Open JDK ${JDK_PATH}"
+
+ANT_PATH=''
+for i in `ls ${INSTALL_JAVA} | grep '\-ant-'`; do
+  ANT_PATH="${ANT_PATH}:${INSTALL_JAVA}/${i}/bin"
+done
+print " - Apache Ant ${ANT_PATH}"
+
+MVN_PATH=''
+for i in `ls ${INSTALL_JAVA} | grep '\-maven-'`; do
+  MVN_PATH="${MVN_PATH}:${INSTALL_JAVA}/${i}/bin"
+done
+print " - Apache Maven ${MVN_PATH}"
+
+if [ -n "${JDK_PATH}" ]; then
+  TOOLS_PATH="${JDK_PATH}"
+else
+  TOOLS_PATH=''
+fi
+if [ -n "${ANT_PATH}" ]; then
+  TOOLS_PATH="${TOOLS_PATH}${ANT_PATH}"
+fi
+if [ -n "${MVN_PATH}" ]; then
+  TOOLS_PATH="${TOOLS_PATH}${MVN_PATH}"
+fi
+
+print " - Adding shell profile PATH ${TOOLS_PATH}"
+echo '# Java tools path
+PATH="${PATH}'"${TOOLS_PATH}"'"
+' > /etc/profile.d/java_tools.sh
+
+print "Fixing startup scripts permissions"
+cd /opt/bin && chmod uog+x mongo-start.sh mongo-stop.sh mysql-start.sh mysql-stop.sh
+
+print "Configuring MySQL 8 yum repository"
+echo '--------------------------------------------------------------------------------'
+cd /tmp && yum -y localinstall '${mysql.pkg}'
+yum -y module disable mysql
+
+echo '--------------------------------------------------------------------------------'
+print "Installing MySQL 8"
+echo '--------------------------------------------------------------------------------'
+yum -y install sudo mysql-community-server
+groupmod -o -g "${JENKINS_GID}" mysql
+usermod -o -g "${JENKINS_GID}" -u "${JENKINS_UID}" mysql
+chown -v mysql:mysql /var/log/mysqld.log
+chown -v -R mysql:mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld
+mysqld --initialize --user=mysql
+echo '--------------------------------------------------------------------------------'
+cat /var/log/mysqld.log
+echo '--------------------------------------------------------------------------------'
+
+print "Setting up MySQL 8 for tests"
+echo '--------------------------------------------------------------------------------'
+#Addtional permanent settings in configuration file
+#To disable check for some stored functions
+echo 'log_bin_trust_function_creators = 1
+' >> /etc/my.cnf
+/opt/bin/mysql-start.sh
+ROOT_PWD=`cat /var/log/mysqld.log | grep 'A temporary password is generated for root' | sed -e 's/^.*localhost: *//'`
+echo "
+  ALTER USER 'root'@'localhost' IDENTIFIED BY '${db.root.pwd}';
+  CREATE DATABASE ${mysql.database};
+  FLUSH PRIVILEGES;
+" | mysql -v -u root --connect-expired-password --password="${ROOT_PWD}"
+if [ '${db.user}' != 'root' ]; then
+  echo "
+    CREATE USER '${db.user}'@'localhost' IDENTIFIED BY '${db.pwd}';
+    GRANT ALL PRIVILEGES ON ${mysql.database}.* TO '${db.user}'@'localhost';
+    FLUSH PRIVILEGES;
+  " | mysql -v -u root --password='${db.root.pwd}'
+fi
+/opt/bin/mysql-stop.sh
+echo '--------------------------------------------------------------------------------'
+
+print "Configuring Mongo DB 3 yum repository"
+echo '--------------------------------------------------------------------------------'
+echo '[Mongodb]
+name=MongoDB Repository
+baseurl=https://repo.mongodb.org/yum/redhat/8/mongodb-org/3.6/x86_64/
+gpgcheck=0
+enabled=1
+gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc
+' > /etc/yum.repos.d/mongodb.repo
+chmod -v u=rw,og=r /etc/yum.repos.d/mongodb.repo
+echo '--------------------------------------------------------------------------------'
+print "Installing Mongo DB 3"
+echo '--------------------------------------------------------------------------------'
+yum install -y mongodb-org
+groupmod -o -g "${JENKINS_GID}" mongod
+usermod -o -g "${JENKINS_GID}" -u "${JENKINS_UID}" mongod
+chown -v -R mongod:mongod /var/lib/mongo /var/log/mongodb /var/run/mongodb
+echo '--------------------------------------------------------------------------------'
+print "Post install cleanup"
+echo '--------------------------------------------------------------------------------'
+yum -y clean all
+rm -vrf /var/cache/yum
diff --git a/etc/jenkins/docker/pom.xml b/etc/jenkins/docker/pom.xml
new file mode 100644
index 0000000..5a98394
--- /dev/null
+++ b/etc/jenkins/docker/pom.xml
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
+
+    This program and the accompanying materials are made available under the
+    terms of the Eclipse Public License v. 2.0 which is available at
+    http://www.eclipse.org/legal/epl-2.0,
+    or the Eclipse Distribution License v. 1.0 which is available at
+    http://www.eclipse.org/org/documents/edl-v10.php.
+
+    SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
+
+-->
+
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <modelVersion>4.0.0</modelVersion>
+
+    <name>EclipseLink Docker Image</name>
+    <description>Docker image used in Eclipse Foundation build infrastructure to build EclipseLink and run LRG tests</description>
+    <groupId>org.eclipse.persistence.build</groupId>
+    <artifactId>org.eclipse.persistence.build.docker</artifactId>
+    <packaging>pom</packaging>
+    <!-- Version is used as target docker image tag -->
+    <version>2.0.0</version>
+
+    <properties>
+        <!-- Source docker image -->
+        <docker.source>oraclelinux:8</docker.source>
+        <!-- Target docker image name-->
+        <docker.image>tkraus/el-build</docker.image>
+        <!-- Packages to be installed -->
+        <java.pkg>jdk-17.0.2_linux-x64_bin.tar.gz</java.pkg>
+        <java.url>https://download.oracle.com/java/17/archive/${java.pkg}</java.url>
+        <ant.pkg>apache-ant-1.10.12-bin.tar.gz</ant.pkg>
+        <ant.url>https://dlcdn.apache.org//ant/binaries/${ant.pkg}</ant.url>
+        <maven.pkg>apache-maven-3.8.5-bin.tar.gz</maven.pkg>
+        <maven.url>https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/${maven.pkg}</maven.url>
+        <mysql.pkg>mysql80-community-release-el8-3.noarch.rpm</mysql.pkg>
+        <mysql.url>https://dev.mysql.com/get/${mysql.pkg}</mysql.url>
+        <mongo.pkg>mysql80-community-release-el8-3.noarch.rpm</mongo.pkg>
+        <mongo.url>https://dev.mysql.com/get/${mysql.pkg}</mongo.url>
+        <!-- Installation directory structure -->
+        <install.root>/opt</install.root>
+        <install.scripts>${install.root}/bin</install.scripts>
+        <install.java>${install.root}/java</install.java>
+        <!-- Jenkins user name and UID -->
+        <build.user.name>jenkins</build.user.name>
+        <build.user.uid>1001560000</build.user.uid>
+        <!-- Jenkins user group and GID -->
+        <build.group.name>jenkins</build.group.name>
+        <build.group.gid>1001560000</build.group.gid>
+        <!-- Jenkins additional user attributes -->
+        <build.user.shell>/bin/bash</build.user.shell>
+        <build.user.comment>Jenkins user</build.user.comment>
+        <!-- Skip install and deploy plugins -->
+        <maven.install.skip>true</maven.install.skip>
+        <maven.deploy.skip>true</maven.deploy.skip>
+        <!-- MySQL database setup properties file -->
+        <mysql.database>ecltests</mysql.database>
+        <mysql.properties.file>${project.basedir}/../../el-test.mysql.properties</mysql.properties.file>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>${project.basedir}/image</directory>
+                <targetPath>${project.build.directory}/image</targetPath>
+                <filtering>true</filtering>
+                <includes>
+                    <include>Dockerfile</include>
+                    <include>install.sh</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>${project.basedir}/scripts</directory>
+                <targetPath>${project.build.directory}/image</targetPath>
+                <filtering>false</filtering>
+                <includes>
+                    <include>*.sh</include>
+                </includes>
+            </resource>
+        </resources>
+
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-resources-plugin</artifactId>
+                    <version>3.2.0</version>
+                </plugin>
+                <plugin>
+                    <groupId>com.googlecode.maven-download-plugin</groupId>
+                    <artifactId>download-maven-plugin</artifactId>
+                    <version>1.6.1</version>
+                </plugin>
+                <plugin>
+                    <groupId>io.fabric8</groupId>
+                    <artifactId>docker-maven-plugin</artifactId>
+                    <version>0.39.1</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>properties-maven-plugin</artifactId>
+                    <version>1.1.0</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+
+        <plugins>
+            <!-- Enable resources processing -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>docker</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>resources</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- Packages download -->
+            <plugin>
+                <groupId>com.googlecode.maven-download-plugin</groupId>
+                <artifactId>download-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>jdk</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>wget</goal>
+                        </goals>
+                        <configuration>
+                            <url>${java.url}</url>
+                            <outputFileName>${java.pkg}</outputFileName>
+                            <outputDirectory>${project.build.directory}/image</outputDirectory>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>ant</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>wget</goal>
+                        </goals>
+                        <configuration>
+                            <url>${ant.url}</url>
+                            <outputFileName>${ant.pkg}</outputFileName>
+                            <outputDirectory>${project.build.directory}/image</outputDirectory>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>maven</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>wget</goal>
+                        </goals>
+                        <configuration>
+                            <url>${maven.url}</url>
+                            <outputFileName>${maven.pkg}</outputFileName>
+                            <outputDirectory>${project.build.directory}/image</outputDirectory>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>mysql</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>wget</goal>
+                        </goals>
+                        <configuration>
+                            <url>${mysql.url}</url>
+                            <outputFileName>${mysql.pkg}</outputFileName>
+                            <outputDirectory>${project.build.directory}/image</outputDirectory>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>default</id>
+                        <phase>none</phase>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- Docker image lifecycle -->
+            <plugin>
+                <groupId>io.fabric8</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+                <configuration>
+                    <images>
+                        <image>
+                            <name>${docker.image}:${project.version}</name>
+                            <build>
+                                <contextDir>${project.build.directory}/image</contextDir>
+                                <buildOptions>
+                                    <squash/>
+                                </buildOptions>
+                            </build>
+                        </image>
+                    </images>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>build-image</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>build</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>deploy-image</id>
+                        <phase>deploy</phase>
+                        <goals>
+                            <goal>push</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>clean-image</id>
+                        <phase>clean</phase>
+                        <goals>
+                            <goal>remove</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>properties-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>initialize</phase>
+                        <goals>
+                            <goal>read-project-properties</goal>
+                        </goals>
+                        <configuration>
+                            <files>
+                                <file>${mysql.properties.file}</file>
+                            </files>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/etc/jenkins/docker/scripts/mongo-start.sh b/etc/jenkins/docker/scripts/mongo-start.sh
new file mode 100644
index 0000000..46580eb
--- /dev/null
+++ b/etc/jenkins/docker/scripts/mongo-start.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+#
+# Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
+
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0 which is available at
+# http://www.eclipse.org/legal/epl-2.0,
+# or the Eclipse Distribution License v. 1.0 which is available at
+# http://www.eclipse.org/org/documents/edl-v10.php.
+
+# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
+
+# Start MySQL database
+
+DATA_DIR='/var/lib/mongo'
+LOG_FILE='/var/log/mongodb/mongod.log'
+PID_FILE='/var/run/mongodb/mongodb.pid'
+PORT='27017'
+
+# Print timestamp and message to sdtout
+# Arguments:
+#   $1 First message to be printed
+#   $2 Second message to be printed
+#   ...
+print() {
+  echo '['`date '+%d.%m.%Y %H:%M:%S'`'] '$@
+}
+
+print '-[ Starting Mongo Database ]------------------------------'
+if [ `id -u` = '0' ]; then
+  sudo -u mongod mongod --port ${PORT} --dbpath ${DATA_DIR} --logpath ${LOG_FILE} --pidfilepath ${PID_FILE} &
+else
+  mongod --port ${PORT} --dbpath ${DATA_DIR} --logpath ${LOG_FILE} --pidfilepath ${PID_FILE} &
+fi
+
+print '--[ Waiting for Mongo Database to come up ]---------------'
+while ! /usr/bin/mongo --eval "db.version()" > /dev/null 2>&1; do
+  sleep 1;
+  echo -n '.'
+done
+echo ' done'
diff --git a/etc/jenkins/docker/scripts/mongo-stop.sh b/etc/jenkins/docker/scripts/mongo-stop.sh
new file mode 100644
index 0000000..1df8436
--- /dev/null
+++ b/etc/jenkins/docker/scripts/mongo-stop.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+#
+# Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
+
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0 which is available at
+# http://www.eclipse.org/legal/epl-2.0,
+# or the Eclipse Distribution License v. 1.0 which is available at
+# http://www.eclipse.org/org/documents/edl-v10.php.
+
+# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
+
+# Stop Mongo database
+
+PID_FILE='/var/run/mongodb/mongodb.pid'
+
+# Print timestamp and message to sdtout
+# Arguments:
+#   $1 First message to be printed
+#   $2 Second message to be printed
+#   ...
+print() {
+  echo '['`date '+%d.%m.%Y %H:%M:%S'`'] '$@
+}
+
+print '-[ Stopping Mongo Database ]------------------------------'
+if [ -f "${PID_FILE}" ]; then
+  MONGO_PID=`cat ${PID_FILE}`
+  if ! kill -s TERM "${MONGO_PID}" ; then
+    print '---[ Mongo could not be stopped! ]------------------------'
+    exit 1
+  fi
+  print '--[ Waiting for Mongo Database to stop ]------------------'
+  while /usr/bin/mongo --eval "db.version()" > /dev/null 2>&1; do
+    sleep 1
+    echo -n '.'
+  done
+  echo ' done'
+else
+  print '--[ Mongo PID file was not found! ]-----------------------'
+  exit 1
+fi
diff --git a/etc/jenkins/docker/scripts/mysql-start.sh b/etc/jenkins/docker/scripts/mysql-start.sh
new file mode 100644
index 0000000..556180c
--- /dev/null
+++ b/etc/jenkins/docker/scripts/mysql-start.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+#
+# Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
+
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0 which is available at
+# http://www.eclipse.org/legal/epl-2.0,
+# or the Eclipse Distribution License v. 1.0 which is available at
+# http://www.eclipse.org/org/documents/edl-v10.php.
+
+# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
+
+# Start MySQL database
+
+# Print timestamp and message to sdtout
+# Arguments:
+#   $1 First message to be printed
+#   $2 Second message to be printed
+#   ...
+print() {
+  echo '['`date '+%d.%m.%Y %H:%M:%S'`'] '$@
+}
+
+print '-[ Starting MySQL Database ]------------------------------'
+if [ `id -u` = '0' ]; then
+  sudo -u mysql mysqld &
+else
+  mysqld &
+fi
+
+print '--[ Waiting for MySQL Database to come up ]---------------'
+while ! mysqladmin --protocol=socket --user=root ping > /dev/null 2>&1; do
+  sleep 1
+  echo -n '.'
+done
+echo ' done'
diff --git a/etc/jenkins/docker/scripts/mysql-stop.sh b/etc/jenkins/docker/scripts/mysql-stop.sh
new file mode 100644
index 0000000..99eb519
--- /dev/null
+++ b/etc/jenkins/docker/scripts/mysql-stop.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+#
+# Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
+
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0 which is available at
+# http://www.eclipse.org/legal/epl-2.0,
+# or the Eclipse Distribution License v. 1.0 which is available at
+# http://www.eclipse.org/org/documents/edl-v10.php.
+
+# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
+
+# Stop MySQL database
+
+# Print timestamp and message to sdtout
+# Arguments:
+#   $1 First message to be printed
+#   $2 Second message to be printed
+#   ...
+print() {
+  echo '['`date '+%d.%m.%Y %H:%M:%S'`'] '$@
+}
+
+print '-[ Stopping MySQL Database ]------------------------------'
+if [ -f /var/run/mysqld/mysqld.pid ]; then
+  MYSQL_PID=`cat /var/run/mysqld/mysqld.pid`
+  if ! kill -s TERM "${MYSQL_PID}" ; then
+    print '---[ MySQL could not be stopped! ]------------------------'
+    exit 1
+  fi
+  print '--[ Waiting for MySQL Database to stop ]------------------'
+  while mysqladmin --protocol=socket --user=root ping > /dev/null 2>&1; do
+    sleep 1
+    echo -n '.'
+  done
+  echo ' done'
+else
+  print '--[ MySQL PID file was not found! ]-----------------------'
+  exit 1
+fi
diff --git a/etc/jenkins/pr_verify.groovy b/etc/jenkins/pr_verify.groovy
index a3c0ecb..3a3b7c2 100644
--- a/etc/jenkins/pr_verify.groovy
+++ b/etc/jenkins/pr_verify.groovy
@@ -1,5 +1,5 @@
 //
-//  Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
+//  Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved.
 //
 //  This program and the accompanying materials are made available under the
 //  terms of the Eclipse Public License v. 2.0 which is available at
@@ -64,7 +64,7 @@
       requests:
         memory: "12Gi"
         cpu: "5.5"
-    image: tkraus/el-build:1.1.9
+    image: tkraus/el-build:2.0.0
     volumeMounts:
     - name: tools
       mountPath: /opt/tools
diff --git a/etc/jenkins/release.groovy b/etc/jenkins/release.groovy
index 3c0c527..d52a677 100644
--- a/etc/jenkins/release.groovy
+++ b/etc/jenkins/release.groovy
@@ -1,4 +1,4 @@
-// Copyright (c) 2020, 2021 Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2020, 2022 Oracle and/or its affiliates. All rights reserved.
 //
 // This program and the accompanying materials are made available under the
 // terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -70,7 +70,7 @@
       requests:
         memory: "4Gi"
         cpu: "1.5"
-    image: tkraus/el-build:1.1.9
+    image: tkraus/el-build:2.0.0
     volumeMounts:
     - name: tools
       mountPath: /opt/tools
diff --git a/etc/jenkins/tck.groovy b/etc/jenkins/tck.groovy
index 00f33ab..906f107 100644
--- a/etc/jenkins/tck.groovy
+++ b/etc/jenkins/tck.groovy
@@ -1,5 +1,5 @@
 //
-//  Copyright (c) 2020, 2021 Oracle and/or its affiliates. All rights reserved.
+//  Copyright (c) 2020, 2022 Oracle and/or its affiliates. All rights reserved.
 //
 //  This program and the accompanying materials are made available under the
 //  terms of the Eclipse Public License v. 2.0 which is available at
@@ -47,7 +47,7 @@
         memory: "1Gi"
         cpu: "500m"
   - name: eclipselink-tck-run
-    image:  tkraus/el-build:1.1.9
+    image:  tkraus/el-build:2.0.0
     resources:
       limits:
         memory: "3Gi"