forked from archguard/archguard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (38 loc) · 2.22 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
FROM openjdk:12-jdk-alpine
RUN apk add --no-cache tzdata git curl && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone && \
apk del tzdata
RUN addgroup -S spring && adduser -S spring -G spring
USER spring:spring
WORKDIR /home/spring
ARG SCAN_VERSION_ARG=1.6.2
ENV SCAN_VERSION=$SCAN_VERSION_ARG
ARG JAR_FILE=./server/build/libs/*.jar
COPY ${JAR_FILE} /home/spring/app.jar
# this is for save version for debug
COPY ["scanner_cli/build/libs/scanner_cli*-all.jar", "/home/spring/"]
# the really scanner jar
COPY ["scanner_cli/build/libs/scanner_cli*-all.jar", "/home/spring/scanner_cli.jar"]
RUN ["mkdir", "-p", "/home/spring/dependencies/analysers/"]
RUN chown -R spring:spring /home/spring/dependencies/analysers/
# copy features & langs & rules
COPY ["analyser_diff_changes/build/libs/analyser_diff_changes*-all.jar", \
"analyser_git/build/libs/analyser_git*-all.jar", \
"analyser_sca/build/libs/analyser_sca*-all.jar", \
"analyser_sourcecode/feat_apicalls/build/libs/feat_apicalls*-all.jar", \
"analyser_sourcecode/feat_datamap/build/libs/feat_datamap*-all.jar", \
"analyser_sourcecode/lang_csharp/build/libs/lang_csharp*-all.jar", \
"analyser_sourcecode/lang_golang/build/libs/lang_golang*-all.jar", \
"analyser_sourcecode/lang_java/build/libs/lang_java*-all.jar", \
"analyser_sourcecode/lang_kotlin/build/libs/lang_kotlin*-all.jar", \
"analyser_sourcecode/lang_python/build/libs/lang_python*-all.jar", \
"analyser_sourcecode/lang_scala/build/libs/lang_scala*-all.jar", \
"analyser_sourcecode/lang_typescript/build/libs/lang_typescript*-all.jar", \
"rule-core/build/libs/rule-core*.jar", \
"rule-linter/rule-sql/build/libs/rule-sql*.jar", \
"rule-linter/rule-webapi/build/libs/rule-webapi*.jar", \
"rule-linter/rule-test-code/build/libs/rule-test-code*.jar", \
# target directory
"/home/spring/dependencies/analysers/"]
ENTRYPOINT ["java","-jar","/home/spring/app.jar","--spring.profiles.active=${app_env}"]