-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
68 lines (54 loc) · 2.61 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM ubuntu:cosmic
# install ubuntu packages from file
COPY ubuntu-dependencies.txt /tmp/
RUN apt-get update && xargs -a /tmp/ubuntu-dependencies.txt apt-get install -y
# add scala build tool (needed for building joern)
RUN echo "deb https://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
RUN apt-get update && apt-get install -y sbt
# python clang bindings
RUN wget --output-document=/tmp/clang-source.tar.xz \
"http://releases.llvm.org/$(llvm-config --version)/cfe-$(llvm-config --version).src.tar.xz"
RUN tar --extract --xz --file="/tmp/clang-source.tar.xz"
RUN mv "/cfe-$(llvm-config --version).src" "/clang-source"
ENV PYTHONPATH "${PYTHONPATH}:/clang-source/bindings/python"
# graph2vec
# can be run via python3 /graph2vec/src/graph2vec.py <args>
RUN git clone https://github.com/benedekrozemberczki/graph2vec.git
# joern
RUN git clone https://github.com/ShiftLeftSecurity/joern.git /joern
# recent commits broke our toProlog and toDot scripts so go
# back to an old one
RUN cd /joern && git checkout cbca30d2631a48aed47be1ba46c6d8b5aa23c103
RUN cd /joern && sbt stage
# Prolog and ILP
RUN git clone --depth 1 https://github.com/vscosta/yap-6.3 /yap
RUN mkdir /yap/build && cd /yap/build && cmake ../ && make && make install
RUN mkdir /aleph && wget --output-document=/aleph/aleph.pl \
"http://www.comlab.ox.ac.uk/oucl/research/areas/machlearn/Aleph/aleph.pl"
RUN git clone --depth 1 https://github.com/metagol/metagol.git /metagol
# Add metagol to swi-prolog path
COPY .swiplrc /root/.swiplrc
# Progol
RUN mkdir /progol
RUN wget --output-document=/progol/progol4_4.tar.gz \
"https://www.doc.ic.ac.uk/~shm/Software/progol4.4/progol4_4.tar.gz"
RUN wget --output-document=/progol/expand.sh \
"https://www.doc.ic.ac.uk/~shm/Software/progol4.4/expand.sh"
RUN cd /progol && gunzip progol4_4.tar.gz && tar xvf progol4_4.tar
RUN cd /progol/source && make CC=gcc-5
RUN cd /progol/source && make CC=gcc-5 qsample
# Python dependencies. These are most likely to change, so go near the bottom.
RUN python -m pip install --upgrade pip
COPY requirements-py2.txt /tmp/
RUN python -m pip install --requirement /tmp/requirements-py2.txt
RUN python3 -m pip install --upgrade pip
COPY requirements-py3.txt /tmp/
RUN python3 -m pip install --requirement /tmp/requirements-py3.txt
# Add python 2 as a kernel for jupyter
RUN python -m pip install ipykernel
RUN python -m ipykernel install
# Run for a jupyter notebook by default
WORKDIR "/project"
EXPOSE 8888
CMD jupyter notebook --allow-root --ip 0.0.0.0 --no-browser