forked from Checkmarx/kics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.antlr
35 lines (27 loc) · 917 Bytes
/
Dockerfile.antlr
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
FROM adoptopenjdk/openjdk11:alpine AS builder
WORKDIR /opt/antlr4
ARG ANTLR_VERSION="4.9.2"
ARG MAVEN_OPTS="-Xmx1G"
RUN apk add --no-cache maven git \
&& git clone https://github.com/antlr/antlr4.git \
&& cd antlr4 \
&& git checkout $ANTLR_VERSION \
&& mvn clean --projects tool --also-make \
&& mvn -DskipTests install --projects tool --also-make \
&& mv ./tool/target/antlr4-*-complete.jar antlr4-tool.jar
FROM adoptopenjdk/openjdk11:alpine-jre
ARG user=appuser
ARG group=appuser
ARG uid=1000
ARG gid=1000
RUN adduser \
--disabled-password \
--gecos "" \
--home "$(pwd)" \
--no-create-home \
--uid "${uid}" \
"${user}"
COPY --from=builder /opt/antlr4/antlr4/antlr4-tool.jar /usr/local/lib/
WORKDIR /work
ENTRYPOINT ["java", "-Xmx500M", "-cp", "/usr/local/lib/antlr4-tool.jar", "org.antlr.v4.Tool"]
CMD [ "-Dlanguage=Go", "-visitor", "-no-listener", "-o", "parser", "JSONFilter.g4" ]