Allow setting external dockerfile for policy-pap 35/130635/1
authordanielhanrahan <daniel.hanrahan@est.tech>
Tue, 30 Aug 2022 07:27:13 +0000 (08:27 +0100)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Thu, 1 Sep 2022 12:56:24 +0000 (13:56 +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: Ica6984b0460e5814df56ab6679003e98b983d397

packages/policy-pap-docker/pom.xml

index 4a180cd..3bf3f4c 100644 (file)
@@ -42,6 +42,7 @@
         <docker.skip>false</docker.skip>
         <docker.skip.build>false</docker.skip.build>
         <docker.skip.push>false</docker.skip.push>
+        <docker.contextDir>${project.basedir}/src/main/docker</docker.contextDir>
         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
     </properties>
 
                             <build>
                                 <cleanup>try</cleanup>
                                 <dockerFile>${dockerFile}</dockerFile>
+                                <contextDir>${docker.contextDir}</contextDir>
                                 <tags>
                                     <tag>${project.version}</tag>
                                     <tag>${project.version}-${maven.build.timestamp}</tag>