-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (26 loc) · 929 Bytes
/
Dockerfile
File metadata and controls
45 lines (26 loc) · 929 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
42
43
44
45
ARG REPO_DIR=/opt/fireworks-layout
# ===== 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 EXEC_JAR_FILE=target/fireworks-exec.jar
ARG VERIFIER_JAR_FILE=target/fireworks-verifier.jar
WORKDIR ${REPO_DIR}
COPY --from=build-jar ${REPO_DIR}/${EXEC_JAR_FILE} ./target/
COPY --from=build-jar ${REPO_DIR}/${VERIFIER_JAR_FILE} ./target/
COPY --from=build-jar ${REPO_DIR}/config/ ./config/
COPY --from=build-jar ${REPO_DIR}/src/main/resources/ ./resources/