File: Dockerfile

package info (click to toggle)
golang-github-antlr-antlr4 4.11.1%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 1,292 kB
  • sloc: makefile: 5
file content (36 lines) | stat: -rw-r--r-- 859 bytes parent folder | download
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
FROM adoptopenjdk/openjdk11:alpine AS builder

WORKDIR /opt/antlr4

ARG ANTLR_VERSION="4.11.1"
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"]