-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
47 lines (40 loc) · 1.79 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
# Dockerfile to build this thing
# Usage:
# docker build -t sqflint_builder .
# docker run -e "GITHUB_WORKSPACE=/opt/build" -v ./:/opt/build sqflint_builder
# Artifacts will be stored in dist
FROM openjdk:8
# Installs Ant
ENV ANT_VERSION 1.10.9
RUN cd /opt && \
wget -q https://downloads.apache.org/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz && \
tar -xzf apache-ant-${ANT_VERSION}-bin.tar.gz && \
mv apache-ant-${ANT_VERSION} /opt/ant && \
rm apache-ant-${ANT_VERSION}-bin.tar.gz
ENV ANT_HOME /opt/ant
ENV PATH ${PATH}:/opt/ant/bin
ARG JAVACC_VERSION=7.0.5
ENV JAVACC_VERSION ${JAVACC_VERSION}
RUN cd /opt && \
wget -q https://github.com/javacc/javacc/archive/${JAVACC_VERSION}.tar.gz && \
tar -xzf ${JAVACC_VERSION}.tar.gz && \
mv javacc-${JAVACC_VERSION} /opt/javacc && \
rm ${JAVACC_VERSION}.tar.gz && \
rm /opt/javacc/scripts/javacc.bat && \
echo '#!/bin/sh' > /opt/javacc/scripts/javacc && \
echo 'JAR=/opt/javacc/target/javacc.jar' >> /opt/javacc/scripts/javacc && \
echo 'case "`uname`" in' >> /opt/javacc/scripts/javacc && \
echo ' CYGWIN*) JAR="`cygpath --windows -- "$JAR"`" ;;' >> /opt/javacc/scripts/javacc && \
echo 'esac' >> /opt/javacc/scripts/javacc && \
echo 'java -classpath "$JAR" javacc "$@"' >> /opt/javacc/scripts/javacc && \
chmod +x /opt/javacc/scripts/javacc && \
cp /opt/javacc/scripts/javacc /opt/javacc/scripts/javacc.bat && \
cd /opt/javacc && \
ant
ENV PATH ${PATH}:/opt/javacc/scripts
RUN mkdir /opt/build && chmod 777 /opt/build
RUN echo '#!/bin/bash' > /opt/buildsqflint.sh && \
echo 'if [ "$ANT_BUILD_DIR" != "" ]; then cd $ANT_BUILD_DIR; fi' >> /opt/buildsqflint.sh && \
echo '/opt/ant/bin/ant' >> /opt/buildsqflint.sh && \
chmod +x /opt/buildsqflint.sh
ENTRYPOINT [ "/opt/buildsqflint.sh" ]