-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·86 lines (64 loc) · 2.8 KB
/
Dockerfile
File metadata and controls
executable file
·86 lines (64 loc) · 2.8 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y \
python3.11 \
python3-pip \
git \
wget \
curl \
zip \
unzip \
rsync \
vim \
&& rm -rf /var/lib/apt/lists/*
RUN arch=$(uname -m) && \
if [ "$arch" = "x86_64" ]; then \
MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"; \
elif [ "$arch" = "aarch64" ]; then \
MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh"; \
else \
echo "Unsupported architecture: $arch"; \
exit 1; \
fi && \
wget $MINICONDA_URL -O miniconda.sh && \
mkdir -p /root/.conda && \
bash miniconda.sh -b -p /root/miniconda3 && \
rm -f miniconda.sh
ENV PATH="/root/miniconda3/bin:${PATH}"
RUN pip3 install --upgrade pip
WORKDIR /home
RUN wget https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz
RUN tar xzvf apache-maven-3.9.9-bin.tar.gz
ENV PATH="/home/apache-maven-3.9.9/bin:${PATH}"
RUN rm apache-maven-3.9.9-bin.tar.gz
RUN git clone https://github.com/Intelligent-CAT-Lab/AlphaTrans.git
WORKDIR /home/AlphaTrans
SHELL ["/bin/bash", "-c"]
RUN conda init bash
RUN echo "source /root/.bashrc && conda activate alphatrans" > /etc/profile.d/conda.sh && \
echo "conda activate alphatrans" >> ~/.bashrc
RUN conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
RUN conda env create -f environment.yaml
RUN bash scripts/install_graal.sh
ENV JAVA_HOME="/root/.sdkman/candidates/java/current"
RUN mkdir -p /home/AlphaTrans/misc/sitter-libs
RUN git clone https://github.com/tree-sitter/tree-sitter-java.git /home/AlphaTrans/misc/sitter-libs/java
RUN git clone https://github.com/tree-sitter/tree-sitter-python.git /home/AlphaTrans/misc/sitter-libs/python
RUN mkdir -p /home/AlphaTrans/misc/java-callgraph
RUN git clone https://github.com/gousiosg/java-callgraph.git /home/AlphaTrans/misc/java-callgraph
WORKDIR /home/AlphaTrans/misc/java-callgraph
RUN mvn clean install -DskipTests
WORKDIR /home/AlphaTrans
RUN wget https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.20.0/codeql-bundle-linux64.tar.gz
RUN tar -xvf codeql-bundle-linux64.tar.gz -C /home/AlphaTrans/misc
RUN rm codeql-bundle-linux64.tar.gz
ENV PATH="/home/AlphaTrans/misc/codeql:$PATH"
RUN git clone https://github.com/github/vscode-codeql-starter.git
WORKDIR /home/AlphaTrans/vscode-codeql-starter
RUN git submodule update --init --remote
WORKDIR /home/AlphaTrans/vscode-codeql-starter/ql
RUN git checkout 3b2e55bc2ac942ac2cf2646f5c69acd081ce8ea2
WORKDIR /home/AlphaTrans
RUN cp queries/* vscode-codeql-starter/codeql-custom-queries-java
RUN bash scripts/download_original_projects.sh
RUN bash scripts/build_java_projects.sh