Skip to content

Commit

Permalink
#1 Reduce container re-build time from 22mins -> 2 secconds
Browse files Browse the repository at this point in the history
by using --mount=type=cache for mvn dependencies
  • Loading branch information
chrisjsimpson committed Sep 9, 2022
1 parent 1bebaa0 commit 0502ad9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ RUN cp /usr/src/OBP-API/obp-api/pom.xml /tmp/pom.xml # For Packaging a local rep
WORKDIR /usr/src/OBP-API
RUN cp obp-api/src/main/resources/props/test.default.props.template obp-api/src/main/resources/props/test.default.props
RUN cp obp-api/src/main/resources/props/sample.props.template obp-api/src/main/resources/props/default.props
RUN mvn install -pl .,obp-commons
RUN mvn install -DskipTests -pl obp-api
RUN --mount=type=cache,target=/root/.m2 mvn install -pl .,obp-commons
RUN --mount=type=cache,target=/root/.m2 mvn install -DskipTests -pl obp-api

FROM openjdk:8-jre-alpine

Expand Down

0 comments on commit 0502ad9

Please # to comment.