-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (24 loc) · 840 Bytes
/
Dockerfile
File metadata and controls
41 lines (24 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
ARG REPO_DIR=/opt/release-update-dois
# ===== stage 1 =====
FROM maven:3.9.6-eclipse-temurin-11-focal AS setup-env
ARG REPO_DIR
WORKDIR ${REPO_DIR}
COPY . .
SHELL ["/bin/bash", "-c"]
# run lint if container started
ENTRYPOINT []
CMD mvn -B -q checkstyle:check | \
grep -i --color=never '\.java\|failed to execute goal' > lint.log && \
exit 1 || \
exit 0
# ===== stage 2 =====
FROM setup-env AS build-jar
RUN mvn clean package
# ===== stage 3 =====
FROM eclipse-temurin:11-jre-focal
ARG REPO_DIR
ARG JAR_FILE=target/update-dois-jar-with-dependencies.jar
ARG JAR_VERIFIER_FILE=target/update-dois-verifier-jar-with-dependencies.jar
WORKDIR ${REPO_DIR}
COPY --from=build-jar ${REPO_DIR}/${JAR_FILE} ./target/
COPY --from=build-jar ${REPO_DIR}/${JAR_VERIFIER_FILE} ./target/