Allow setting external dockerfile for drools-pdp 78/130678/1
authordanielhanrahan <daniel.hanrahan@est.tech>
Fri, 2 Sep 2022 13:20:40 +0000 (14:20 +0100)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Fri, 2 Sep 2022 13:20:40 +0000 (14:20 +0100)
If building with an external dockerfile, e.g. using
 mvn clean install -Pdocker -DdockerFile=/path/to/dockerfile
docker will look for project files in the same directory as the
new dockerfile. A new property is added for setting the context
path, to allow using existing project files in src/main/docker.

Issue-ID: POLICY-4334
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: Ifc93fe3d748d21409f3532aec73430edea665ee3

packages/docker/pom.xml

index 79fd73a..ba2793d 100644 (file)
@@ -43,6 +43,7 @@
         <docker.skip.build>false</docker.skip.build>
         <docker.skip.push>false</docker.skip.push>
         <docker.skip.deployconfig>true</docker.skip.deployconfig>
+        <docker.contextDir>${project.basedir}/src/main/docker</docker.contextDir>
         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
         <docker.buildArg.BUILD_VERSION_DROOLS>${project.version}</docker.buildArg.BUILD_VERSION_DROOLS>
         <docker.buildArg.MVN_SNAPSHOT_REPO_URL>${nexusproxy}/${snapshots.path}</docker.buildArg.MVN_SNAPSHOT_REPO_URL>
                             <build>
                                 <cleanup>try</cleanup>
                                 <dockerFile>${dockerFile}</dockerFile>
+                                <contextDir>${docker.contextDir}</contextDir>
                                 <tags>
                                     <tag>${project.version}</tag>
                                     <tag>${project.version}-${maven.build.timestamp}</tag>