-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (55 loc) · 2.15 KB
/
Dockerfile
File metadata and controls
68 lines (55 loc) · 2.15 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
# Use an official Java runtime as a parent image
FROM openjdk:8
# Set the working directory inside the container
WORKDIR /katch
# Install sbt
RUN apt-get update && \
apt-get install -y apt-transport-https curl gnupg && \
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list && \
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list && \
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add && \
apt-get update && \
apt-get install -y sbt opam graphviz
# Get Frenetic for comparison
RUN git clone https://www.github.com/frenetic-lang/frenetic.git
WORKDIR /katch/frenetic
RUN git checkout guarded
RUN opam init --disable-sandboxing && opam switch create 4.13.0
RUN opam install --deps-only -y .
RUN opam install -y dune
# In lieu of `eval $(opam env)`:
ENV OPAM_SWITCH_PREFIX='/root/.opam/4.13.0'
ENV CAML_LD_LIBRARY_PATH='/root/.opam/4.13.0/lib/stublibs:/root/.opam/4.13.0/lib/ocaml/stublibs:/root/.opam/4.13.0/lib/ocaml'
ENV OCAML_TOPLEVEL_PATH='/root/.opam/4.13.0/lib/toplevel'
ENV MANPATH=':/root/.opam/4.13.0/man'
ENV PATH='/root/.opam/4.13.0/bin:/usr/local/openjdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
RUN dune build || printf "ok\n"
RUN dune install
WORKDIR /katch
# Install dependencies to generate plots
RUN apt-get install -y python3-pip
RUN pip install matplotlib seaborn jinja2
# Copy the sources
COPY src src
COPY project project
COPY build.sbt build.sbt
# Compile KATch and make a fat jar
RUN sbt compile
RUN sbt assembly
# Copy the relevant contents into the container at /katch
COPY nkpl/tutorial.nkpl nkpl/tutorial.nkpl
COPY nkpl/fig09 nkpl/fig09
COPY nkpl/fig10 nkpl/fig10
COPY nkpl/fig11 nkpl/fig11
COPY nkpl/fig10-less-cogentco nkpl/fig10-less-cogentco
COPY nkpl/networks nkpl/networks
COPY nkpl/tests nkpl/tests
COPY scripts scripts
COPY katch katch
# Make results
RUN mkdir results
RUN touch results/results.txt
RUN mkdir results/plots
# Put the user in the shell
# They have to run the image with the -it flag: `docker run -it katch`
CMD ["/bin/bash"]