-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
27 lines (17 loc) · 916 Bytes
/
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
FROM openjdk:17-jdk-slim
RUN apt-get update && apt-get install -y \
curl \
sed \
&& rm -rf /var/lib/apt/lists/*
ARG ANTLR_VERSION
ARG COMMIT_HASH
ENV ANTLR_VERSION=$ANTLR_VERSION
ENV COMMIT_HASH=$COMMIT_HASH
RUN curl -O https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar
ENV CLASSPATH=".:/antlr-${ANTLR_VERSION}-complete.jar:$CLASSPATH"
ENV ANTLR_JAR=/antlr-${ANTLR_VERSION}-complete.jar
RUN echo "alias antlr='java -jar /antlr-${ANTLR_VERSION}-complete.jar'" >> ~/.bashrc
WORKDIR /workspace
RUN curl -L -o YQL.g4 https://raw.githubusercontent.com/ydb-platform/ydb/${COMMIT_HASH}/yql/essentials/sql/v1/SQLv1Antlr4.g.in
RUN sed -i "s/grammar SQLv1Antlr4/grammar YQL/g; s/@GRAMMAR_STRING_CORE_SINGLE@/~('\\\'\' | '\\\\\\\\') | ('\\\\\\\\' .)/g; s/@GRAMMAR_STRING_CORE_DOUBLE@/~('\\\"\' | '\\\\\\\\') | ('\\\\\\\\' .)/g; s/@GRAMMAR_MULTILINE_COMMENT_CORE@/./g" YQL.g4
CMD ["bash"]