-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
83 lines (79 loc) · 2.72 KB
/
Dockerfile
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FROM oven/bun:1.1.44-slim AS bun
FROM maven:3.9.9-amazoncorretto-21-debian AS builder
WORKDIR /app
COPY pom.xml .
COPY .m2/settings.xml .
RUN mvn -gs settings.xml -B clean package -Dmaven.main.skip -Dmaven.test.skip -Dcodegen.skip && rm -r target
COPY src ./src
RUN mvn -gs settings.xml -B package -Dmaven.test.skip
# Check layers with
# java -Djarmode=layertools -jar target/jasper-1.3.0-SNAPSHOT.jar list
RUN java -Djarmode=layertools -jar target/*.jar extract
FROM builder AS test
COPY docker/entrypoint.sh .
ENV BUN_RUNTIME_TRANSPILER_CACHE_PATH=0
ENV BUN_INSTALL_BIN=/usr/local/bin
COPY --from=bun /usr/local/bin/bun /usr/local/bin/
RUN ln -s /usr/local/bin/bun /usr/local/bin/bunx \
&& which bun \
&& which bunx \
&& bun --version
ENV JASPER_NODE=/usr/local/bin/bun
RUN rm /etc/apt/sources.list.d/corretto.list
RUN apt-get update && apt-get install python3 python3-venv python3-pip python3-yaml -y \
&& which python3 \
&& python3 --version
ENV JASPER_PYTHON=/usr/bin/python3
RUN apt-get update && apt-get install wget bash jq uuid-runtime -y \
&& which jq \
&& jq --version \
&& uuidgen jq \
&& uuidgen --version \
&& which bash \
&& bash --version
ARG JASPER_SHELL=/usr/bin/bash
CMD mvn -gs settings.xml test surefire-report:report; \
mkdir -p /tests && \
cp target/surefire-reports/* /tests/ && \
mkdir -p /reports && \
cp -r target/reports/* /reports/ && \
cp target/reports/surefire.html /reports/index.html
FROM test AS gatling
CMD mvn -gs settings.xml gatling:test; \
mkdir -p /report && \
cp -r target/gatling/simplejaspersimulation-*/* /report/
FROM azul/zulu-openjdk-debian:21.0.5-21.38-jre AS deploy
RUN apt-get update && apt-get install curl -y
ENV BUN_RUNTIME_TRANSPILER_CACHE_PATH=0
ENV BUN_INSTALL_BIN=/usr/local/bin
COPY --from=bun /usr/local/bin/bun /usr/local/bin/
RUN ln -s /usr/local/bin/bun /usr/local/bin/bunx \
&& which bun \
&& which bunx \
&& bun --version
ARG JASPER_NODE=/usr/local/bin/bun
ENV JASPER_NODE=${JASPER_NODE}
RUN apt-get update && apt-get install python3 python3-venv python3-pip python3-yaml -y \
&& which python3 \
&& python3 --version
ARG JASPER_PYTHON=/usr/bin/python3
ENV JASPER_PYTHON=${JASPER_PYTHON}
RUN apt-get update && apt-get install wget bash jq uuid-runtime -y \
&& which jq \
&& jq --version \
&& uuidgen jq \
&& uuidgen --version \
&& which bash \
&& bash --version
ARG JASPER_SHELL=/usr/bin/bash
ENV JASPER_SHELL=${JASPER_SHELL}
WORKDIR /app
COPY --from=builder /app/dependencies/ ./
RUN true
COPY --from=builder /app/spring-boot-loader/ ./
RUN true
COPY --from=builder /app/snapshot-dependencies/ ./
RUN true
COPY --from=builder /app/application/ ./
COPY docker/entrypoint.sh .
ENTRYPOINT ["sh", "entrypoint.sh"]