Allow setting external dockerfile for apex-pdp 36/130636/1
authordanielhanrahan <daniel.hanrahan@est.tech>
Thu, 1 Sep 2022 13:55:46 +0000 (14:55 +0100)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Thu, 1 Sep 2022 13:55:46 +0000 (14:55 +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: I52606f85b720449e8ed9b532e55200c9f825e3cd

packages/apex-pdp-docker/pom.xml

index ed5733b..16f2370 100644 (file)
@@ -40,6 +40,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>