From 2e75608d00105a17639029fa6ac81f7d852408b4 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Wed, 20 Nov 2024 15:08:09 +0000 Subject: [PATCH] parent style build --- docker-compose.yml | 8 ++++++++ hello-world-alt/Dockerfile | 23 +++++++++++++++++++++++ hello-world/Dockerfile | 8 +++++--- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 docker-compose.yml create mode 100644 hello-world-alt/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0baa942 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: '2' +services: + angular: + image: ${DOCKER_REG_PRIVATE}/orcid/test/hello-world:${TAG:-0.0.1} + #entrypoint: sleep infinity + build: + context: . + dockerfile: hello-world/Dockerfile diff --git a/hello-world-alt/Dockerfile b/hello-world-alt/Dockerfile new file mode 100644 index 0000000..8f82c49 --- /dev/null +++ b/hello-world-alt/Dockerfile @@ -0,0 +1,23 @@ +FROM maven:3.6.3-jdk-11 AS maven + +WORKDIR /build + +# copy only poms for max cachability of just dependency downloads +COPY hello-world-alt/pom.xml hello-world-alt/pom.xml + +COPY pom.xml . + +# download maven dependencies +RUN mvn -T 1C --batch-mode \ + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ + --file "hello-world-alt/pom.xml" \ + dependency:resolve + +COPY hello-world-alt/src hello-world-alt/src + +RUN mvn -T 1C --batch-mode \ + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ + --file "hello-world-alt/pom.xml" \ + package -Dmaven.test.skip + + diff --git a/hello-world/Dockerfile b/hello-world/Dockerfile index c7f16ed..f5f02b7 100644 --- a/hello-world/Dockerfile +++ b/hello-world/Dockerfile @@ -3,19 +3,21 @@ FROM maven:3.6.3-jdk-11 AS maven WORKDIR /build # copy only poms for max cachability of just dependency downloads +COPY hello-world/pom.xml hello-world/pom.xml + COPY pom.xml . # download maven dependencies RUN mvn -T 1C --batch-mode \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - --file "pom.xml" \ + --file "hello-world/pom.xml" \ dependency:resolve -COPY ./src ./src +COPY hello-world/src hello-world/src RUN mvn -T 1C --batch-mode \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - --file "pom.xml" \ + --file "hello-world/pom.xml" \ package -Dmaven.test.skip