This is an automated email from the ASF dual-hosted git repository.

danwatford pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 4e398d890b Fixed: Allow conditional copying of plugins to docker 
container (OFBIZ-12781)
4e398d890b is described below

commit 4e398d890b5af52e67ccbf88f5a81ff30898693c
Author: Daniel Watford <dan...@watfordconsulting.com>
AuthorDate: Tue Mar 21 12:25:40 2023 +0000

    Fixed: Allow conditional copying of plugins to docker container 
(OFBIZ-12781)
    
    To support docker container builds with and without plugins, apply a Go
    Character Class regular expression matcher on the source plugins
    directory.
---
 .dockerignore                              |  4 ++++
 Dockerfile                                 | 11 ++++++-----
 docker/templates/postgres-entityengine.xml | 12 ------------
 3 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/.dockerignore b/.dockerignore
index 86fb0090f5..b9f34af116 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -5,3 +5,7 @@ Dockerfile
 /runtime/
 /themes/common-theme/webapp/common/js/node_modules/
 /themes/common-theme/webapp/common-theme/js/node_modules/
+/plugins/.svn
+/plugins/.github
+/plugins/.git
+
diff --git a/Dockerfile b/Dockerfile
index 51c49b64d9..c22482f58f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
 # syntax=docker/dockerfile:1
-FROM eclipse-temurin:17 as builder
+FROM eclipse-temurin:17 AS builder
 
 # Git is used for various OFBiz build tasks.
 RUN apt-get update \
@@ -24,7 +24,8 @@ COPY config/ config/
 COPY framework/ framework/
 COPY gradle/ gradle/
 COPY lib/ lib/
-COPY plugins/ plugins/
+# We use a regex to match the plugins directory to avoid a build error when 
the directory doesn't exist.
+COPY plugin[s]/ plugins/
 COPY themes/ themes/
 COPY APACHE2_HEADER build.gradle common.gradle gradle.properties NOTICE 
settings.gradle .
 
@@ -35,7 +36,7 @@ RUN 
--mount=type=cache,id=gradle-cache,sharing=locked,target=/root/.gradle \
 
 
###################################################################################
 
-FROM eclipse-temurin:17 as runtimebase
+FROM eclipse-temurin:17 AS runtimebase
 
 RUN ["useradd", "ofbiz"]
 
@@ -72,7 +73,7 @@ CMD ["bin/ofbiz"]
 
###################################################################################
 # Load demo data before defining volumes. This results in a container image
 # that is ready to go for demo purposes.
-FROM runtimebase as demo
+FROM runtimebase AS demo
 
 USER ofbiz
 
@@ -88,7 +89,7 @@ VOLUME ["/ofbiz/config", "/ofbiz/runtime", "/ofbiz/lib-extra"]
 
 
###################################################################################
 # Runtime image with no data loaded.
-FROM runtimebase as runtime
+FROM runtimebase AS runtime
 
 USER ofbiz
 
diff --git a/docker/templates/postgres-entityengine.xml 
b/docker/templates/postgres-entityengine.xml
index 2cfaa8d39e..b9485c3407 100644
--- a/docker/templates/postgres-entityengine.xml
+++ b/docker/templates/postgres-entityengine.xml
@@ -140,12 +140,6 @@ access. For a detailed description see the 
core/docs/entityconfig.html file.
                 pool-maxsize="250"
                 time-between-eviction-runs-millis="600000"/><!-- Be warned 
that at this date (2009-09-20) the max_connections parameters in postgresql.conf
                     is set by default to 100 by the initdb process see 
http://www.postgresql.org/docs/8.4/static/runtime-config-connection.html#GUC-MAX-CONNECTIONS-->
-
-        <!-- <jndi-jdbc jndi-server-name="default" 
jndi-name="java:comp/env/jdbc/localpostgres" 
isolation-level="ReadCommitted"/>-->
-        <!-- <jndi-jdbc jndi-server-name="default" 
jndi-name="comp/env/jdbc/xa/localpostgres" isolation-level="ReadCommitted"/> 
--> <!-- Orion Style JNDI name -->
-        <!-- <jndi-jdbc jndi-server-name="localweblogic" 
jndi-name="PostgresDataSource"/> --> <!-- Weblogic Style JNDI name -->
-        <!-- <jndi-jdbc jndi-server-name="default" 
jndi-name="jdbc/localpostgres" isolation-level="ReadCommitted"/> --> <!-- JRun4 
Style JNDI name -->
-        <!-- <tyrex-dataSource dataSource-name="localpostgres" 
isolation-level="ReadCommitted"/> -->
     </datasource>
 
     <datasource name="localpostgrestenant"
@@ -178,11 +172,5 @@ access. For a detailed description see the 
core/docs/entityconfig.html file.
                 pool-maxsize="250"
                 time-between-eviction-runs-millis="600000"/><!-- Be warned 
that at this date (2009-09-20) the max_connections parameters in postgresql.conf
                     is set by default to 100 by the initdb process see 
http://www.postgresql.org/docs/8.4/static/runtime-config-connection.html#GUC-MAX-CONNECTIONS-->
-
-        <!-- <jndi-jdbc jndi-server-name="default" 
jndi-name="java:comp/env/jdbc/localpostgres" 
isolation-level="ReadCommitted"/>-->
-        <!-- <jndi-jdbc jndi-server-name="default" 
jndi-name="comp/env/jdbc/xa/localpostgres" isolation-level="ReadCommitted"/> 
--> <!-- Orion Style JNDI name -->
-        <!-- <jndi-jdbc jndi-server-name="localweblogic" 
jndi-name="PostgresDataSource"/> --> <!-- Weblogic Style JNDI name -->
-        <!-- <jndi-jdbc jndi-server-name="default" 
jndi-name="jdbc/localpostgres" isolation-level="ReadCommitted"/> --> <!-- JRun4 
Style JNDI name -->
-        <!-- <tyrex-dataSource dataSource-name="localpostgres" 
isolation-level="ReadCommitted"/> -->
     </datasource>
 </entity-config>

Reply via email to