Skip to content

Commit

Permalink
parent style build
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesw committed Nov 20, 2024
1 parent 4b07cba commit 2e75608
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions hello-world-alt/Dockerfile
Original file line number Diff line number Diff line change
@@ -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


8 changes: 5 additions & 3 deletions hello-world/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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


0 comments on commit 2e75608

Please sign in to comment.