From 6893818396c94cd28d70a24bdd45428a15ef9f46 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Tue, 30 Sep 2025 13:36:25 -0700 Subject: [PATCH 01/30] LPD-62912 Add configs for SQL Server --- .../liferay/docker/workspace/environments/Config.groovy | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy b/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy index ca1b0770..6ae06e73 100644 --- a/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy +++ b/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy @@ -191,6 +191,12 @@ class Config { this.dockerContainerDatabase = "${this.namespace}-database-postgres" } + if (this.services.contains("sqlserver")) { + this.useDatabase = true + this.useDatabaseSQLServer = true + this.dockerContainerDatabase = "${this.namespace}-database-sqlserver" + } + if (this.services.contains("webserver_http") && this.services.contains("webserver_https")) { throw new GradleException("Both HTTP and HTTPS are enabled for the webserver service. Only one protocol can be active at a time.") } @@ -300,6 +306,7 @@ class Config { public boolean useDatabaseMariaDB = false public boolean useDatabaseMySQL = false public boolean useDatabasePostgreSQL = false + public boolean useDatabaseSQLServer = false public boolean useLiferay = false public boolean useWebserverHttp = false public boolean useWebserverHttps = false From 441b2c9ed6472d37c7b5b98813c2da288fdca850 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Tue, 30 Sep 2025 13:37:52 -0700 Subject: [PATCH 02/30] LPD-62912 Include SQL Server JDBC jar in bundle --- build.gradle | 3 +++ .../src/main/groovy/docker-liferay-bundle.gradle | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/build.gradle b/build.gradle index 8e6791b1..84888b5d 100644 --- a/build.gradle +++ b/build.gradle @@ -130,12 +130,14 @@ buildDockerImage { dependsOn ":checkForLiferayLicense" dependsOn ":prepareDB2JDBCDriver" + dependsOn ":prepareSQLServerJDBCDriver" mustRunAfter ":importDatabaseDumps" } clean { dependsOn ":cleanPrepareDB2JDBCDriver" + dependsOn ":cleanPrepareSQLServerJDBCDriver" dependsOn ":cleanPrepareHotfixes" dependsOn ":cleanPrepareSelfSignedCert" dependsOn ":cleanPrepareWebserverConfig" @@ -145,6 +147,7 @@ clean { dockerDeploy { dependsOn ":prepareDB2JDBCDriver" + dependsOn ":prepareSQLServerJDBCDriver" dependsOn ":prepareHotfixes" dependsOn ":prepareYourKitAgent" } diff --git a/buildSrc/src/main/groovy/docker-liferay-bundle.gradle b/buildSrc/src/main/groovy/docker-liferay-bundle.gradle index 81771d50..efd6a896 100644 --- a/buildSrc/src/main/groovy/docker-liferay-bundle.gradle +++ b/buildSrc/src/main/groovy/docker-liferay-bundle.gradle @@ -12,10 +12,12 @@ project.plugins.apply "docker-common" configurations { db2 + sqlserver } dependencies { db2 group: "com.ibm.db2.jcc", name: "db2jcc", version: "db2jcc4" + sqlserver group: "com.microsoft.sqlserver", name: "mssql-jdbc", version: "12.10.1.jre11" } Closure isValidLicenseFile = { @@ -202,6 +204,18 @@ tasks.register("prepareDB2JDBCDriver", Copy) { into "configs/common/tomcat/webapps/ROOT/WEB-INF/shielded-container-lib" } +tasks.register("prepareSQLServerJDBCDriver", Copy) { + onlyIf("using the Liferay service") { + config.useLiferay + } + onlyIf("using the SQL Server database") { + config.useDatabaseSQLServer + } + + from configurations.sqlserver + into "configs/common/tomcat/webapps/ROOT/WEB-INF/shielded-container-lib" +} + tasks.register("validateHotfixURLs") { onlyIf("using the Liferay service") { config.useLiferay From 3f76e263fd0b195e52c3b56c34adf299df95afc2 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Tue, 30 Sep 2025 13:39:13 -0700 Subject: [PATCH 03/30] LPD-62912 Reuse DB2 database results for SQL Server --- buildSrc/src/main/groovy/docker-common.gradle | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/docker-common.gradle b/buildSrc/src/main/groovy/docker-common.gradle index 63a605c0..d432ddd2 100644 --- a/buildSrc/src/main/groovy/docker-common.gradle +++ b/buildSrc/src/main/groovy/docker-common.gradle @@ -50,7 +50,7 @@ ext { return toResultRows(results, /,/) } - if (config.useDatabaseDB2) { + if (config.useDatabaseDB2 || config.useDatabaseSQLServer) { List results = waitForCommand("${getDatabaseAccessCommand(schema)} \"${sql}\"").split("\n").minus("") results.removeLast() @@ -98,7 +98,12 @@ ext { return config.companyVirtualHosts } - config.companyVirtualHosts = executeSQLQuery("select companyId, hostname, webId from VirtualHost inner join Company using (companyId) where layoutSetId = 0", config.databaseName) + if (config.useDatabaseSQLServer) { + config.companyVirtualHosts = executeSQLQuery("select VirtualHost.companyId, hostname, webId from VirtualHost inner join Company on (VirtualHost.companyId = Company.companyId) where layoutSetId = 0", config.databaseName) + } + else { + config.companyVirtualHosts = executeSQLQuery("select companyId, hostname, webId from VirtualHost inner join Company using (companyId) where layoutSetId = 0", config.databaseName) + } return config.companyVirtualHosts } @@ -134,6 +139,10 @@ ext { "docker compose exec --user db2admin -it database /opt/ibm/db2/V11.5/bin/db2" ].join("\n") } + + if (config.useDatabaseSQLServer) { + return "docker compose exec -it database /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -C -P Liferay123 -d ${config.databaseName} -Q" + } } getCompanyDefaultWebId = { From 020f54df1ec3b884a17dae5f318024b3a8ab53a9 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Tue, 30 Sep 2025 13:41:11 -0700 Subject: [PATCH 04/30] LPD-62912 Add recipe files for SQL Server --- compose-recipes/sqlserver/Dockerfile | 19 ++++++ .../sqlserver/clustering.sqlserver.yaml | 7 +++ compose-recipes/sqlserver/entrypoint.sh | 61 +++++++++++++++++++ compose-recipes/sqlserver/init.sql | 2 + .../sqlserver/liferay.sqlserver.yaml | 10 +++ compose-recipes/sqlserver/reinit.sql | 7 +++ .../sqlserver/service.sqlserver.yaml | 30 +++++++++ 7 files changed, 136 insertions(+) create mode 100644 compose-recipes/sqlserver/Dockerfile create mode 100644 compose-recipes/sqlserver/clustering.sqlserver.yaml create mode 100644 compose-recipes/sqlserver/entrypoint.sh create mode 100644 compose-recipes/sqlserver/init.sql create mode 100644 compose-recipes/sqlserver/liferay.sqlserver.yaml create mode 100644 compose-recipes/sqlserver/reinit.sql create mode 100644 compose-recipes/sqlserver/service.sqlserver.yaml diff --git a/compose-recipes/sqlserver/Dockerfile b/compose-recipes/sqlserver/Dockerfile new file mode 100644 index 00000000..f27c812b --- /dev/null +++ b/compose-recipes/sqlserver/Dockerfile @@ -0,0 +1,19 @@ +FROM mcr.microsoft.com/mssql/server:2022-CU21-ubuntu-22.04 + +USER root + +RUN mkdir -p /var/opt/mssql/backups /var/opt/mssql/data +RUN chown -R mssql:mssql /var/opt/mssql/ +RUN touch /startup_log.txt +RUN chown mssql:mssql /startup_log.txt + +COPY entrypoint.sh /init/ +COPY init.sql /init/ +COPY reinit.sql /init + +RUN chown -R mssql:mssql /init && \ + chmod a+x /init/entrypoint.sh + +USER mssql + +ENTRYPOINT ["/bin/bash", "/init/entrypoint.sh"] \ No newline at end of file diff --git a/compose-recipes/sqlserver/clustering.sqlserver.yaml b/compose-recipes/sqlserver/clustering.sqlserver.yaml new file mode 100644 index 00000000..f9906d0d --- /dev/null +++ b/compose-recipes/sqlserver/clustering.sqlserver.yaml @@ -0,0 +1,7 @@ +services: + liferay-cluster-node: + environment: + - LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_DRIVER_UPPERCASEC_LASS_UPPERCASEN_AME=com.microsoft.sqlserver.jdbc.SQLServerDriver + - LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_PASSWORD=Liferay123 + - LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_URL=jdbc:sqlserver://database:1433;databaseName=lportal;Encrypt=True;TrustServerCertificate=True + - LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_USERNAME=sa \ No newline at end of file diff --git a/compose-recipes/sqlserver/entrypoint.sh b/compose-recipes/sqlserver/entrypoint.sh new file mode 100644 index 00000000..989f1729 --- /dev/null +++ b/compose-recipes/sqlserver/entrypoint.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +_sqlcmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P ${MSSQL_SA_PASSWORD}" + +_has_database_files() { + local database_name=${1} + + if [[ $(ls /var/opt/mssql/data | grep ${database_name}) ]]; then + echo true + fi +} + +_is_database_present() { + local database_name=${1} + + if [[ $(${_sqlcmd} -Q "select name from sys.databases" | grep "${database_name}") ]]; then + + echo true + fi +} + +create_database() { + local database_name=${1} + + if [[ $(_is_database_present ${database_name}) ]]; then + echo "Database ${database_name} is present; skipping database creation" + + return + fi + + if [[ $(_has_database_files ${database_name}) ]]; then + echo "Database files found; reattaching database ${database_name}..." + + sed -i "s,%DATABASE_NAME%,${database_name},g" /init/reinit.sql + + ${_sqlcmd} -i /init/reinit.sql + + return + fi + + echo "Could not find database ${database_name}; creating database..." + + sed -i "s,%DATABASE_NAME%,${database_name},g" /init/init.sql + + ${_sqlcmd} -i /init/init.sql + + return +} + +main() { + until ${_sqlcmd} -Q "SELECT 1"; do + sleep 1 + echo "[entrypoint] Waiting for SQL Server to be available..." + done + + create_database ${COMPOSER_DATABASE_NAME} +} + +main & /opt/mssql/bin/sqlservr + +wait \ No newline at end of file diff --git a/compose-recipes/sqlserver/init.sql b/compose-recipes/sqlserver/init.sql new file mode 100644 index 00000000..735ce181 --- /dev/null +++ b/compose-recipes/sqlserver/init.sql @@ -0,0 +1,2 @@ +CREATE DATABASE %DATABASE_NAME% +GO \ No newline at end of file diff --git a/compose-recipes/sqlserver/liferay.sqlserver.yaml b/compose-recipes/sqlserver/liferay.sqlserver.yaml new file mode 100644 index 00000000..ab7c401d --- /dev/null +++ b/compose-recipes/sqlserver/liferay.sqlserver.yaml @@ -0,0 +1,10 @@ +services: + liferay: + depends_on: + database: + condition: service_healthy + environment: + - LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_DRIVER_UPPERCASEC_LASS_UPPERCASEN_AME=com.microsoft.sqlserver.jdbc.SQLServerDriver + - LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_PASSWORD=Liferay123 + - LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_URL=jdbc:sqlserver://database:1433;databaseName=lportal;Encrypt=True;TrustServerCertificate=True + - LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_USERNAME=sa \ No newline at end of file diff --git a/compose-recipes/sqlserver/reinit.sql b/compose-recipes/sqlserver/reinit.sql new file mode 100644 index 00000000..70eec1cc --- /dev/null +++ b/compose-recipes/sqlserver/reinit.sql @@ -0,0 +1,7 @@ +USE master +GO +CREATE DATABASE %DATABASE_NAME% +ON (FILENAME = /var/opt/mssql/data/%DATABASE_NAME%.mdf), +(FILENAME = /var/opt/mssql/data/%DATABASE_NAME%.ldf) +FOR ATTACH +GO \ No newline at end of file diff --git a/compose-recipes/sqlserver/service.sqlserver.yaml b/compose-recipes/sqlserver/service.sqlserver.yaml new file mode 100644 index 00000000..00c8f694 --- /dev/null +++ b/compose-recipes/sqlserver/service.sqlserver.yaml @@ -0,0 +1,30 @@ +services: + data-helper: + volumes: + - sqlserver:/container-data/sqlserver + database: + build: ./compose-recipes/sqlserver + container_name: ${NAMESPACE}-database-sqlserver + deploy: + resources: + limits: + memory: 2G + reservations: + memory: 2G + environment: + - ACCEPT_EULA=Y + - COMPOSER_DATABASE_NAME=${DATABASE_NAME} + - MSSQL_SA_PASSWORD=Liferay123 + healthcheck: + interval: 5s + retries: 50 + start_period: 30s + test: /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P Liferay123 -Q "select name from sys.databases where name = ${DATABASE_NAME}" + timeout: 5s + ports: + - "1433:1433" + volumes: + - dumps:/var/opt/mssql/backups + - sqlserver:/var/opt/mssql/data +volumes: + sqlserver: \ No newline at end of file From 730a4f429fbdf867c737b60d9a9f919f703a22a2 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Tue, 30 Sep 2025 13:42:03 -0700 Subject: [PATCH 05/30] LPD-62912 Optionally change ownership for SQL Server files in data-helper --- Dockerfile.helper | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Dockerfile.helper b/Dockerfile.helper index 2dac7934..ef8fbdd1 100644 --- a/Dockerfile.helper +++ b/Dockerfile.helper @@ -1,7 +1,15 @@ -FROM busybox:latest +FROM alpine:latest ARG DATA_DIRECTORY=data USER 1000 -COPY --chown=1000:1000 ${DATA_DIRECTORY} /container-data \ No newline at end of file +COPY --chown=1000:1000 ${DATA_DIRECTORY} /container-data + +USER root + +RUN ([ -d /container-data/sqlserver ] && addgroup --gid 10001 mssql && adduser -S -s /usr/sbin/nologin -h /home/mssql --disabled-password -G mssql -u 10001 mssql) || echo + +RUN ([ -d /container-data/sqlserver ] && chown -R 10001:10001 /container-data/sqlserver) || echo + +USER 1000 \ No newline at end of file From bd54b0290694a29f7f37226b4567e05e34543196 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Tue, 30 Sep 2025 13:42:20 -0700 Subject: [PATCH 06/30] LPD-62912 Expose property for SQL Server --- gradle.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/gradle.properties b/gradle.properties index 13253e84..49295b3b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -46,6 +46,7 @@ lr.docker.environment.service.enabled[mail]=false lr.docker.environment.service.enabled[mariadb]=false lr.docker.environment.service.enabled[mysql]=false lr.docker.environment.service.enabled[postgres]=false +lr.docker.environment.service.enabled[sqlserver]=false lr.docker.environment.service.enabled[webserver_http]=false lr.docker.environment.service.enabled[webserver_https]=false From 9829c007702b03f695745e7108699525f18dc4bb Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Tue, 30 Sep 2025 13:42:29 -0700 Subject: [PATCH 07/30] LPD-62912 Update README --- README.markdown | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.markdown b/README.markdown index bb5b1d1e..5ff7d217 100644 --- a/README.markdown +++ b/README.markdown @@ -29,6 +29,8 @@ To shut down the environment, run `./gradlew stop`. - [Enable MySQL 8.4](#enable-mysql-84) - [Enable PostgreSQL 16.3](#enable-postgresql-163) +- [Enable DB2 11.5](#enable-db2-115) +- [Enable Microsoft SQL Server 2022](#enable-microsoft-sql-server-2022) - [Import a database dump](#import-a-database-dump) - [Enable database partitioning (MySQL and PostgreSQL only)](#enable-database-partitioning-mysql-and-postgresql-only) - [Configure database port](#configure-database-port) @@ -228,6 +230,26 @@ Set the `lr.docker.environment.service.enabled[postgres]` property to `true` or lr.docker.environment.service.enabled[postgres]=true ``` +#### Enable DB2 11.5 + +Set the `lr.docker.environment.service.enabled[db2]` property to `true` or `1` in `gradle.properties`. + +`gradle.properties`: + +```properties +lr.docker.environment.service.enabled[db2]=true +``` + +#### Enable Microsoft SQL Server 2022 + +Set the `lr.docker.environment.service.enabled[sqlserver]` property to `true` or `1` in `gradle.properties`. + +`gradle.properties`: + +```properties +lr.docker.environment.service.enabled[sqlserver]=true +``` + #### Import a database dump Database dump files can be added to the `./dumps` directory at the root of the Workspace. They will automatically be copied into the database container. From 1fe39ac680656676b2c91470e16a8b7ebb442dbd Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Tue, 30 Sep 2025 14:50:39 -0700 Subject: [PATCH 08/30] LPD-62912 Copy as root --- Dockerfile.helper | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Dockerfile.helper b/Dockerfile.helper index ef8fbdd1..4dc4eb96 100644 --- a/Dockerfile.helper +++ b/Dockerfile.helper @@ -2,12 +2,8 @@ FROM alpine:latest ARG DATA_DIRECTORY=data -USER 1000 - COPY --chown=1000:1000 ${DATA_DIRECTORY} /container-data -USER root - RUN ([ -d /container-data/sqlserver ] && addgroup --gid 10001 mssql && adduser -S -s /usr/sbin/nologin -h /home/mssql --disabled-password -G mssql -u 10001 mssql) || echo RUN ([ -d /container-data/sqlserver ] && chown -R 10001:10001 /container-data/sqlserver) || echo From 9473df879557b2edcf3fd7f410555e6a374e7fca Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Tue, 30 Sep 2025 15:49:04 -0700 Subject: [PATCH 09/30] LPD-62912 Using busybox is sufficient --- Dockerfile.helper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.helper b/Dockerfile.helper index 4dc4eb96..81168d34 100644 --- a/Dockerfile.helper +++ b/Dockerfile.helper @@ -1,4 +1,4 @@ -FROM alpine:latest +FROM busybox:latest ARG DATA_DIRECTORY=data From 6b87728123649992d8351d09462de8e772cfc10b Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 1 Oct 2025 14:49:35 -0700 Subject: [PATCH 10/30] LPD-62912 Convert to elif statements --- compose-recipes/sqlserver/entrypoint.sh | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/compose-recipes/sqlserver/entrypoint.sh b/compose-recipes/sqlserver/entrypoint.sh index 989f1729..2321ff0b 100644 --- a/compose-recipes/sqlserver/entrypoint.sh +++ b/compose-recipes/sqlserver/entrypoint.sh @@ -24,27 +24,19 @@ create_database() { if [[ $(_is_database_present ${database_name}) ]]; then echo "Database ${database_name} is present; skipping database creation" - - return - fi - - if [[ $(_has_database_files ${database_name}) ]]; then + elif [[ $(_has_database_files ${database_name}) ]]; then echo "Database files found; reattaching database ${database_name}..." sed -i "s,%DATABASE_NAME%,${database_name},g" /init/reinit.sql ${_sqlcmd} -i /init/reinit.sql + else + echo "Could not find database ${database_name}; creating database..." - return - fi - - echo "Could not find database ${database_name}; creating database..." - - sed -i "s,%DATABASE_NAME%,${database_name},g" /init/init.sql + sed -i "s,%DATABASE_NAME%,${database_name},g" /init/init.sql - ${_sqlcmd} -i /init/init.sql - - return + ${_sqlcmd} -i /init/init.sql + fi } main() { From 1bf9e940fb4584559761dd1400c2ef9b63f745fc Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 1 Oct 2025 14:57:21 -0700 Subject: [PATCH 11/30] LPD-62912 Add restore to entrypoint --- compose-recipes/sqlserver/Dockerfile | 1 + compose-recipes/sqlserver/entrypoint.sh | 16 ++++++++++++++++ compose-recipes/sqlserver/restore.sql | 5 +++++ 3 files changed, 22 insertions(+) create mode 100644 compose-recipes/sqlserver/restore.sql diff --git a/compose-recipes/sqlserver/Dockerfile b/compose-recipes/sqlserver/Dockerfile index f27c812b..4748d13d 100644 --- a/compose-recipes/sqlserver/Dockerfile +++ b/compose-recipes/sqlserver/Dockerfile @@ -10,6 +10,7 @@ RUN chown mssql:mssql /startup_log.txt COPY entrypoint.sh /init/ COPY init.sql /init/ COPY reinit.sql /init +COPY restore.sql /init RUN chown -R mssql:mssql /init && \ chmod a+x /init/entrypoint.sh diff --git a/compose-recipes/sqlserver/entrypoint.sh b/compose-recipes/sqlserver/entrypoint.sh index 2321ff0b..a3176a75 100644 --- a/compose-recipes/sqlserver/entrypoint.sh +++ b/compose-recipes/sqlserver/entrypoint.sh @@ -2,6 +2,12 @@ _sqlcmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P ${MSSQL_SA_PASSWORD}" +_has_backup_file() { + if [[ $(find /var/opt/mssql/backups -type f -iname "*.bak") ]]; then + echo true + fi +} + _has_database_files() { local database_name=${1} @@ -24,6 +30,16 @@ create_database() { if [[ $(_is_database_present ${database_name}) ]]; then echo "Database ${database_name} is present; skipping database creation" + elif [[ $(_has_backup_file) ]]; then + echo "Database backup found; restoring database ${database_name}..." + + sed -i "s,%DATABASE_NAME%,${database_name},g" /init/restore.sql + + local backup_file=$(find /opt/var/mssql/backups -type f -iname "*.bak") + + sed -i "s,%BACKUP_FILE%,${backup_file},g" /init/restore.sql + + ${_sqlcmd} -i /init/restore.sql elif [[ $(_has_database_files ${database_name}) ]]; then echo "Database files found; reattaching database ${database_name}..." diff --git a/compose-recipes/sqlserver/restore.sql b/compose-recipes/sqlserver/restore.sql new file mode 100644 index 00000000..764c2ce9 --- /dev/null +++ b/compose-recipes/sqlserver/restore.sql @@ -0,0 +1,5 @@ +USE master +GO +RESTORE DATABASE %DATABASE_NAME% +FROM DISK = N'%BACKUP_FILE%' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5 +GO \ No newline at end of file From 531744da56bccf825e75efe7691bf2861b884f91 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 1 Oct 2025 15:00:12 -0700 Subject: [PATCH 12/30] LPD-62912 Update condition --- compose-recipes/sqlserver/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose-recipes/sqlserver/entrypoint.sh b/compose-recipes/sqlserver/entrypoint.sh index a3176a75..ea1926f7 100644 --- a/compose-recipes/sqlserver/entrypoint.sh +++ b/compose-recipes/sqlserver/entrypoint.sh @@ -11,7 +11,7 @@ _has_backup_file() { _has_database_files() { local database_name=${1} - if [[ $(ls /var/opt/mssql/data | grep ${database_name}) ]]; then + if [[ $(find /var/opt/mssql/backups -type f -iname "${database_name}.*") ]]; then echo true fi } From 4f8a859d15a8fe3defe67a2ffc9de7a48a2419e4 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 1 Oct 2025 15:32:31 -0700 Subject: [PATCH 13/30] LPD-62912 Add config for database type --- .../com/liferay/docker/workspace/environments/Config.groovy | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy b/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy index 6ae06e73..95f0df57 100644 --- a/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy +++ b/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy @@ -169,29 +169,34 @@ class Config { this.useClustering = this.useLiferay && this.clusterNodes > 0 if (this.services.contains("db2")) { + this.databaseType = "db2" this.useDatabase = true this.useDatabaseDB2 = true this.dockerContainerDatabase = "${this.namespace}-database-db2" } if (this.services.contains("mariadb")) { + this.databaseType = "db2" this.useDatabase = true this.useDatabaseMariaDB = true } if (this.services.contains("mysql")) { + this.databaseType = "mysql" this.useDatabase = true this.useDatabaseMySQL = true this.dockerContainerDatabase = "${this.namespace}-database-mysql" } if (this.services.contains("postgres")) { + this.databaseType = "postgres" this.useDatabase = true this.useDatabasePostgreSQL = true this.dockerContainerDatabase = "${this.namespace}-database-postgres" } if (this.services.contains("sqlserver")) { + this.databaseType = "sqlserver" this.useDatabase = true this.useDatabaseSQLServer = true this.dockerContainerDatabase = "${this.namespace}-database-sqlserver" @@ -283,6 +288,7 @@ class Config { public List> companyVirtualHosts = null public List composeFiles = new ArrayList() public String databaseName = "lportal" + public String databaseType = "" public boolean databasePartitioningEnabled = false public String dataDirectory = "data" public Map defaultCompanyVirtualHost = null From c73b8447d0375e35567142391d7ad15bde8225e0 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 1 Oct 2025 15:33:00 -0700 Subject: [PATCH 14/30] LPD-62912 Consolidate jdbc driver tasks into one --- build.gradle | 9 +++------ .../main/groovy/docker-liferay-bundle.gradle | 20 ++++--------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/build.gradle b/build.gradle index 84888b5d..305c6b8b 100644 --- a/build.gradle +++ b/build.gradle @@ -129,15 +129,13 @@ buildDockerImage { } dependsOn ":checkForLiferayLicense" - dependsOn ":prepareDB2JDBCDriver" - dependsOn ":prepareSQLServerJDBCDriver" + dependsOn ":prepareJDBCDriver" mustRunAfter ":importDatabaseDumps" } clean { - dependsOn ":cleanPrepareDB2JDBCDriver" - dependsOn ":cleanPrepareSQLServerJDBCDriver" + dependsOn ":cleanPrepareJDBCDriver" dependsOn ":cleanPrepareHotfixes" dependsOn ":cleanPrepareSelfSignedCert" dependsOn ":cleanPrepareWebserverConfig" @@ -146,8 +144,7 @@ clean { } dockerDeploy { - dependsOn ":prepareDB2JDBCDriver" - dependsOn ":prepareSQLServerJDBCDriver" + dependsOn ":prepareJDBCDriver" dependsOn ":prepareHotfixes" dependsOn ":prepareYourKitAgent" } diff --git a/buildSrc/src/main/groovy/docker-liferay-bundle.gradle b/buildSrc/src/main/groovy/docker-liferay-bundle.gradle index efd6a896..d18e1c14 100644 --- a/buildSrc/src/main/groovy/docker-liferay-bundle.gradle +++ b/buildSrc/src/main/groovy/docker-liferay-bundle.gradle @@ -192,27 +192,15 @@ tasks.register("checkForLiferayLicense") { } } -tasks.register("prepareDB2JDBCDriver", Copy) { +tasks.register("prepareJDBCDriver", Copy) { onlyIf("using the Liferay service") { config.useLiferay } - onlyIf("using the DB2 database") { - config.useDatabaseDB2 + onlyIf("not using MySQL or PostgreSQL") { + config.useDatabaseDB2 || config.useDatabaseSQLServer } - from configurations.db2 - into "configs/common/tomcat/webapps/ROOT/WEB-INF/shielded-container-lib" -} - -tasks.register("prepareSQLServerJDBCDriver", Copy) { - onlyIf("using the Liferay service") { - config.useLiferay - } - onlyIf("using the SQL Server database") { - config.useDatabaseSQLServer - } - - from configurations.sqlserver + from configurations.(config.databaseType) into "configs/common/tomcat/webapps/ROOT/WEB-INF/shielded-container-lib" } From f196aea04316b4246ab3cdabdcfdfe3f188ff5e9 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 1 Oct 2025 15:33:26 -0700 Subject: [PATCH 15/30] LPD-62912 Add missing MariaDB config for consistency --- .../com/liferay/docker/workspace/environments/Config.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy b/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy index 95f0df57..eb76e687 100644 --- a/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy +++ b/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy @@ -179,6 +179,7 @@ class Config { this.databaseType = "db2" this.useDatabase = true this.useDatabaseMariaDB = true + this.dockerContainerDatabase = "${this.namespace}-database-mariadb" } if (this.services.contains("mysql")) { From 630271bf738cebea11197ce8c00c628950e63dca Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 1 Oct 2025 16:23:27 -0700 Subject: [PATCH 16/30] LPD-62912 Run copy task conditionally --- buildSrc/src/main/groovy/docker-liferay-bundle.gradle | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/docker-liferay-bundle.gradle b/buildSrc/src/main/groovy/docker-liferay-bundle.gradle index d18e1c14..13f130bb 100644 --- a/buildSrc/src/main/groovy/docker-liferay-bundle.gradle +++ b/buildSrc/src/main/groovy/docker-liferay-bundle.gradle @@ -200,8 +200,10 @@ tasks.register("prepareJDBCDriver", Copy) { config.useDatabaseDB2 || config.useDatabaseSQLServer } - from configurations.(config.databaseType) - into "configs/common/tomcat/webapps/ROOT/WEB-INF/shielded-container-lib" + if (config.databaseType) { + from configurations.(config.databaseType) + into "configs/common/tomcat/webapps/ROOT/WEB-INF/shielded-container-lib" + } } tasks.register("validateHotfixURLs") { From f6ce5350604125e2dc44ff1c48daddfd299fb25f Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 1 Oct 2025 16:23:47 -0700 Subject: [PATCH 17/30] LPD-62912 Add mssql jdbc jar to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9fa8570a..74f48b2b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ **/*.iml **/*.so **/*db2jcc4.jar +**/*mssql-jdbc-12.10.1.jre11.jar **/*dxp-license-*.xml **/*hotfix*.zip **/.classpath From c1c5f01a078953adee3ead213bb98049afc5f536 Mon Sep 17 00:00:00 2001 From: Drew Brokke Date: Thu, 2 Oct 2025 14:42:19 -0500 Subject: [PATCH 18/30] LPD-62912 uses the configuration itself to conditionally run the task --- .../src/main/groovy/docker-liferay-bundle.gradle | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/buildSrc/src/main/groovy/docker-liferay-bundle.gradle b/buildSrc/src/main/groovy/docker-liferay-bundle.gradle index 13f130bb..f8e7b4ec 100644 --- a/buildSrc/src/main/groovy/docker-liferay-bundle.gradle +++ b/buildSrc/src/main/groovy/docker-liferay-bundle.gradle @@ -192,18 +192,20 @@ tasks.register("checkForLiferayLicense") { } } +Configuration dbDriverConfiguration = configurations.findByName(config.databaseType) + tasks.register("prepareJDBCDriver", Copy) { onlyIf("using the Liferay service") { config.useLiferay } - onlyIf("not using MySQL or PostgreSQL") { - config.useDatabaseDB2 || config.useDatabaseSQLServer + onlyIf("there is a database driver to install") { + dbDriverConfiguration != null } - if (config.databaseType) { - from configurations.(config.databaseType) - into "configs/common/tomcat/webapps/ROOT/WEB-INF/shielded-container-lib" + from { + dbDriverConfiguration } + into "configs/common/tomcat/webapps/ROOT/WEB-INF/shielded-container-lib" } tasks.register("validateHotfixURLs") { From 53a0b8f4d8def8838aa1c69575bf4ad9471a5b4a Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 8 Oct 2025 14:59:27 -0700 Subject: [PATCH 19/30] LPD-62912 Ensure dump is owned by mssql user when using SQL Server --- buildSrc/src/main/groovy/docker-common.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/buildSrc/src/main/groovy/docker-common.gradle b/buildSrc/src/main/groovy/docker-common.gradle index d432ddd2..7c6d49c7 100644 --- a/buildSrc/src/main/groovy/docker-common.gradle +++ b/buildSrc/src/main/groovy/docker-common.gradle @@ -22,6 +22,10 @@ ext { println waitForCommand("docker run --rm -v ${volumeName}:/target busybox:latest du -sh /target/${targetName}") + if (config.useDatabaseSQLServer) { + waitForCommand("docker run --rm -v ${volumeName}:/target busybox:latest chown 10001:10001 /target/${targetName}") + } + println "Copied file ${sourcePath} to ${volumeName}" } From 4b2d942bad7afa67c3312d5fb598cad7393f32ca Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 8 Oct 2025 15:01:05 -0700 Subject: [PATCH 20/30] LPD-62912 Ensure column name is single quoted to avoid keyword --- buildSrc/src/main/groovy/docker-database-saas.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/docker-database-saas.gradle b/buildSrc/src/main/groovy/docker-database-saas.gradle index cc579db2..952fdcb3 100644 --- a/buildSrc/src/main/groovy/docker-database-saas.gradle +++ b/buildSrc/src/main/groovy/docker-database-saas.gradle @@ -175,7 +175,7 @@ ext { disableUserObjectValidations = { String schema -> - executeSQLQuery("update ObjectValidationRule set active_ = false where objectDefinitionId in (select objectDefinitionId from ObjectDefinition where externalReferenceCode = 'L_USER')", schema) + executeSQLQuery("update ObjectValidationRule set active_ = 'false' where objectDefinitionId in (select objectDefinitionId from ObjectDefinition where externalReferenceCode = 'L_USER')", schema) println "Disabled object validation users for User system object in schema ${schema}" } @@ -253,7 +253,7 @@ ext { sanitizePortalPreferenceValues(schema, sanitizedPreferences) - executeSQLQuery("update MBMailingList set inServerName = 'fake-pop3-host', outServerName = 'fake-smtp-host', inPassword = 'fake-pop3-password', outPassword = 'fake-smtp-password', active_ = false", schema) + executeSQLQuery("update MBMailingList set inServerName = 'fake-pop3-host', outServerName = 'fake-smtp-host', inPassword = 'fake-pop3-password', outPassword = 'fake-smtp-password', active_ = 'false'", schema) println "Sanitized known POP and SMTP configurations in schema ${schema}" } From e631132f84e2db10de3e3c0fda5a7471d9d839dd Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 8 Oct 2025 15:02:12 -0700 Subject: [PATCH 21/30] LPD-62912 Include backup file for sql server --- buildSrc/src/main/groovy/docker-database-saas.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/buildSrc/src/main/groovy/docker-database-saas.gradle b/buildSrc/src/main/groovy/docker-database-saas.gradle index 952fdcb3..c3adc185 100644 --- a/buildSrc/src/main/groovy/docker-database-saas.gradle +++ b/buildSrc/src/main/groovy/docker-database-saas.gradle @@ -457,6 +457,7 @@ tasks.register("copyDatabaseDumpsToDumpsVolume") { waitForCommand("docker compose create database") fileTree("dumps") { + include "**/*.bak" include "**/*.sql" include "**/*.sql.gz" include "**/*.gz" From 44dbd38021e5b65d5477f9db6fbdc89c69f3add8 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 8 Oct 2025 15:02:27 -0700 Subject: [PATCH 22/30] LPD-62912 Fix backup file path --- compose-recipes/sqlserver/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose-recipes/sqlserver/entrypoint.sh b/compose-recipes/sqlserver/entrypoint.sh index ea1926f7..93b08d8f 100644 --- a/compose-recipes/sqlserver/entrypoint.sh +++ b/compose-recipes/sqlserver/entrypoint.sh @@ -35,7 +35,7 @@ create_database() { sed -i "s,%DATABASE_NAME%,${database_name},g" /init/restore.sql - local backup_file=$(find /opt/var/mssql/backups -type f -iname "*.bak") + local backup_file=$(find /var/opt/mssql/backups -type f -iname "*.bak") sed -i "s,%BACKUP_FILE%,${backup_file},g" /init/restore.sql From 467a68b4c5d347e5922cf7dc75f8f9f471abefae Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 8 Oct 2025 15:12:12 -0700 Subject: [PATCH 23/30] LPD-62912 Return empty map if no results are found --- buildSrc/src/main/groovy/docker-common.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/buildSrc/src/main/groovy/docker-common.gradle b/buildSrc/src/main/groovy/docker-common.gradle index 7c6d49c7..6ca16771 100644 --- a/buildSrc/src/main/groovy/docker-common.gradle +++ b/buildSrc/src/main/groovy/docker-common.gradle @@ -57,6 +57,10 @@ ext { if (config.useDatabaseDB2 || config.useDatabaseSQLServer) { List results = waitForCommand("${getDatabaseAccessCommand(schema)} \"${sql}\"").split("\n").minus("") + if (results.size() <= 1) { + return Collections.emptyMap() + } + results.removeLast() results.remove(1) From 54254f62d0a1fd26c9ea6c4c415d57b0342613f7 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 8 Oct 2025 15:27:04 -0700 Subject: [PATCH 24/30] LPD-62912 Fix database file location --- compose-recipes/sqlserver/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose-recipes/sqlserver/entrypoint.sh b/compose-recipes/sqlserver/entrypoint.sh index 93b08d8f..c4ebdc9c 100644 --- a/compose-recipes/sqlserver/entrypoint.sh +++ b/compose-recipes/sqlserver/entrypoint.sh @@ -11,7 +11,7 @@ _has_backup_file() { _has_database_files() { local database_name=${1} - if [[ $(find /var/opt/mssql/backups -type f -iname "${database_name}.*") ]]; then + if [[ $(find /var/opt/mssql/data -type f -iname "${database_name}.*") ]]; then echo true fi } From d2e5d0030f34848eb29a05f8a4eede58fb87294e Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 8 Oct 2025 15:37:35 -0700 Subject: [PATCH 25/30] LPD-62912 Fix health check --- compose-recipes/sqlserver/service.sqlserver.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose-recipes/sqlserver/service.sqlserver.yaml b/compose-recipes/sqlserver/service.sqlserver.yaml index 00c8f694..7bb7ba6d 100644 --- a/compose-recipes/sqlserver/service.sqlserver.yaml +++ b/compose-recipes/sqlserver/service.sqlserver.yaml @@ -19,7 +19,7 @@ services: interval: 5s retries: 50 start_period: 30s - test: /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P Liferay123 -Q "select name from sys.databases where name = ${DATABASE_NAME}" + test: /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P Liferay123 -Q "select name from sys.databases where name = ${DATABASE_NAME}" | grep -q ${DATABASE_NAME} timeout: 5s ports: - "1433:1433" From 70538d9b4e75b410693c9a3d7e029df54d736308 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 8 Oct 2025 16:38:59 -0700 Subject: [PATCH 26/30] LPD-62912 Use early returns --- compose-recipes/sqlserver/entrypoint.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/compose-recipes/sqlserver/entrypoint.sh b/compose-recipes/sqlserver/entrypoint.sh index c4ebdc9c..c5b56ea4 100644 --- a/compose-recipes/sqlserver/entrypoint.sh +++ b/compose-recipes/sqlserver/entrypoint.sh @@ -30,7 +30,11 @@ create_database() { if [[ $(_is_database_present ${database_name}) ]]; then echo "Database ${database_name} is present; skipping database creation" - elif [[ $(_has_backup_file) ]]; then + + return + fi + + if [[ $(_has_backup_file) ]]; then echo "Database backup found; restoring database ${database_name}..." sed -i "s,%DATABASE_NAME%,${database_name},g" /init/restore.sql @@ -40,19 +44,25 @@ create_database() { sed -i "s,%BACKUP_FILE%,${backup_file},g" /init/restore.sql ${_sqlcmd} -i /init/restore.sql - elif [[ $(_has_database_files ${database_name}) ]]; then + + return + fi + + if [[ $(_has_database_files ${database_name}) ]]; then echo "Database files found; reattaching database ${database_name}..." sed -i "s,%DATABASE_NAME%,${database_name},g" /init/reinit.sql ${_sqlcmd} -i /init/reinit.sql - else - echo "Could not find database ${database_name}; creating database..." - - sed -i "s,%DATABASE_NAME%,${database_name},g" /init/init.sql - ${_sqlcmd} -i /init/init.sql + return fi + + echo "Could not find database ${database_name}; creating database..." + + sed -i "s,%DATABASE_NAME%,${database_name},g" /init/init.sql + + ${_sqlcmd} -i /init/init.sql } main() { From 7ae54a91e0d7bca6b0d0f27f024fd27bd1e19c26 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 8 Oct 2025 16:40:01 -0700 Subject: [PATCH 27/30] LPD-62912 Make entrypoint echos clearer --- compose-recipes/sqlserver/entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compose-recipes/sqlserver/entrypoint.sh b/compose-recipes/sqlserver/entrypoint.sh index c5b56ea4..a54882a1 100644 --- a/compose-recipes/sqlserver/entrypoint.sh +++ b/compose-recipes/sqlserver/entrypoint.sh @@ -29,13 +29,13 @@ create_database() { local database_name=${1} if [[ $(_is_database_present ${database_name}) ]]; then - echo "Database ${database_name} is present; skipping database creation" + echo "[entrypoint] Database ${database_name} is present; skipping database creation" return fi if [[ $(_has_backup_file) ]]; then - echo "Database backup found; restoring database ${database_name}..." + echo "[entrypoint] Database backup found; restoring database ${database_name}..." sed -i "s,%DATABASE_NAME%,${database_name},g" /init/restore.sql @@ -58,7 +58,7 @@ create_database() { return fi - echo "Could not find database ${database_name}; creating database..." + echo "[entrypoint] Could not find database ${database_name}; creating database..." sed -i "s,%DATABASE_NAME%,${database_name},g" /init/init.sql From 1736a2db9c5216e1121a04ffd8df062e7a5c0127 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Thu, 9 Oct 2025 15:13:04 -0700 Subject: [PATCH 28/30] LPD-62912 Fix DB type --- .../com/liferay/docker/workspace/environments/Config.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy b/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy index eb76e687..67b2903b 100644 --- a/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy +++ b/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy @@ -176,7 +176,7 @@ class Config { } if (this.services.contains("mariadb")) { - this.databaseType = "db2" + this.databaseType = "mariadb" this.useDatabase = true this.useDatabaseMariaDB = true this.dockerContainerDatabase = "${this.namespace}-database-mariadb" From cdd3244eced4669014342caa50aa2c39bb874211 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Thu, 9 Oct 2025 15:16:51 -0700 Subject: [PATCH 29/30] LPD-62912 Field not used --- .../com/liferay/docker/workspace/environments/Config.groovy | 6 ------ 1 file changed, 6 deletions(-) diff --git a/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy b/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy index 67b2903b..cbd6a849 100644 --- a/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy +++ b/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy @@ -172,35 +172,30 @@ class Config { this.databaseType = "db2" this.useDatabase = true this.useDatabaseDB2 = true - this.dockerContainerDatabase = "${this.namespace}-database-db2" } if (this.services.contains("mariadb")) { this.databaseType = "mariadb" this.useDatabase = true this.useDatabaseMariaDB = true - this.dockerContainerDatabase = "${this.namespace}-database-mariadb" } if (this.services.contains("mysql")) { this.databaseType = "mysql" this.useDatabase = true this.useDatabaseMySQL = true - this.dockerContainerDatabase = "${this.namespace}-database-mysql" } if (this.services.contains("postgres")) { this.databaseType = "postgres" this.useDatabase = true this.useDatabasePostgreSQL = true - this.dockerContainerDatabase = "${this.namespace}-database-postgres" } if (this.services.contains("sqlserver")) { this.databaseType = "sqlserver" this.useDatabase = true this.useDatabaseSQLServer = true - this.dockerContainerDatabase = "${this.namespace}-database-sqlserver" } if (this.services.contains("webserver_http") && this.services.contains("webserver_https")) { @@ -293,7 +288,6 @@ class Config { public boolean databasePartitioningEnabled = false public String dataDirectory = "data" public Map defaultCompanyVirtualHost = null - public String dockerContainerDatabase = null public String dockerImageLiferay = null public boolean dockerImageLiferayDXP = false public boolean glowrootEnabled = false From 121e76cf98e9084d2a91d00f72d8ac9db069a562 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Thu, 9 Oct 2025 17:00:34 -0700 Subject: [PATCH 30/30] LPD-62912 Add missing documentation --- README.markdown | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.markdown b/README.markdown index 5ff7d217..930dc60b 100644 --- a/README.markdown +++ b/README.markdown @@ -30,6 +30,7 @@ To shut down the environment, run `./gradlew stop`. - [Enable MySQL 8.4](#enable-mysql-84) - [Enable PostgreSQL 16.3](#enable-postgresql-163) - [Enable DB2 11.5](#enable-db2-115) +- [Enable MariaDB 10.6](#enable-mariadb-106) - [Enable Microsoft SQL Server 2022](#enable-microsoft-sql-server-2022) - [Import a database dump](#import-a-database-dump) - [Enable database partitioning (MySQL and PostgreSQL only)](#enable-database-partitioning-mysql-and-postgresql-only) @@ -240,6 +241,16 @@ Set the `lr.docker.environment.service.enabled[db2]` property to `true` or `1` i lr.docker.environment.service.enabled[db2]=true ``` +#### Enable MariaDB 10.6 + +Set the `lr.docker.environment.service.enabled[mariadb]` property to `true` or `1` in `gradle.properties`. + +`gradle.properties`: + +```properties +lr.docker.environment.service.enabled[mariadb]=true +``` + #### Enable Microsoft SQL Server 2022 Set the `lr.docker.environment.service.enabled[sqlserver]` property to `true` or `1` in `gradle.properties`.