-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (17 loc) · 810 Bytes
/
Copy pathDockerfile
File metadata and controls
23 lines (17 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# syntax=docker/dockerfile:experimental
## WARNING This build requires experimental features (native build and buildkit)
## run with the following command
## COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose up --build
## If needed invalidate the cache with
#docker builder prune --filter type=exec.cachemount
ARG JRE=adoptopenjdk/openjdk11:jre-11.0.9_11-alpine
FROM maven:3.6.3-jdk-11-openj9 as BUILD
WORKDIR /build
COPY . /build
RUN --mount=type=cache,target=/root/.m2 mvn -B -e -T 1C clean verify
FROM ${JRE} as Server
COPY --from=BUILD /build/Server/target/*-jar-with-dependencies.jar /MyApp.jar
ENTRYPOINT java $JAVA_OPTS -jar /MyApp.jar
FROM ${JRE} as JavaClient
COPY --from=BUILD /build/JavaClient/target/*-jar-with-dependencies.jar /MyApp.jar
ENTRYPOINT java $JAVA_OPTS -jar /MyApp.jar