Deploy xwiki using Docker with an existing MySQL service

Today, I tried to deploy xwiki by Docker,
And because I have an existing MySQL 8 Service already, So I did NOT follow to create an docker network and deploy a xwiki specified MySQL service by Docker first, just created a xwiki database and the xwiki user, then use the following command to create xwiki container.

docker run -d --name xwiki --restart always \
    -h xwiki \
    -p 30010:8080 \
    -e DB_USER=xwiki \
    -e DB_PASSWORD=mypassword \
    -e DB_DATABASE=xwiki \
    -e DB_HOST= \
    -v /home/me/docker-data/xwiki:/usr/local/xwiki \
    -v /etc/localtime:/etc/localtime \

But, the error below showed as xwiki container init.

Caused by: java.sql.SQLException: Connections using insecure transport are prohibited while --require_secure_transport=ON.
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(
	at com.mysql.cj.jdbc.ConnectionImpl.<init>(
	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(
	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(
	at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(
	at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(
	at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(
	... 50 common frames omitted

Someone can tell me how can I create the xwiki container in this situation? Thanks.

My existing MySQL 8 Service enabled two options below:


You’ll need to find how to configure Hibernate to establish a secure connection to your MySQL server (or turn the secure transport to OFF).


Maybe the following is enough:

<property name="hibernate.connection.url">jdbc:mysql://blablaba:8443/dbname?useSSL=true</property>
<property name="hibernate.connection.verifyServerCertificate">false</property>
<property name="hibernate.connection.requireSSL">true</property>

You can edit your hibernate.cfg.xml file in your permanent directory on your host (/home/me/docker-data/xwiki).