-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
71 lines (60 loc) · 2.32 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
69
70
71
FROM cjen1/reckon-mininet:latest as base
RUN apt-get update && apt-get install --no-install-recommends -yy -qq \
build-essential \
software-properties-common
RUN ln /usr/bin/ovs-testcontroller /usr/bin/controller
# Build dependencies
RUN apt-get update && apt-get install --no-install-recommends -yy -qq \
autoconf \
automake \
libtool \
curl \
g++ \
unzip \
python-is-python3
## Add stretch backports
#RUN echo 'deb http://ftp.debian.org/debian stretch-backports main' | sudo tee /etc/apt/sources.list.d/stretch-backports.list
#RUN apt-get update && apt-get install -yy -qq \
# openjdk-11-jdk
# Runtime dependencies
RUN python -m pip install --upgrade wheel setuptools
ADD requirements.txt requirements.txt
RUN python -m pip install -r requirements.txt
RUN apt-get update && apt-get install --no-install-recommends -yy -qq psmisc iptables
# Test dependencies
RUN apt-get update && apt-get install --no-install-recommends -yy -qq \
tmux \
screen \
strace \
linux-tools-common \
tcpdump \
lsof \
vim \
netcat \
locales-all \
git
# Add ocons dependencies
RUN bash -c "sh <(curl -L https://nixos.org/nix/install) --daemon"
RUN bash -c "echo 'experimental-features = nix-command flakes' > /etc/nix/nix.conf"
# Build ocons impl and client
# Required for silly reasons that ocaml has difficulty
RUN git init .
ADD ./reckon/systems/ocons/ocons-src/flake.nix ./reckon/systems/ocons/ocons-src/flake.lock ./reckon/systems/ocons/ocons-src/dune-project reckon/systems/ocons/ocons-src/
# Cache reckon build without files (also caches client deps)
RUN git add . && bash -l -c "nix build -j auto ./reckon/systems/ocons/ocons-src"
# Build client
ADD ./reckon/ocaml_client reckon/ocaml_client
ADD ./reckon/systems/ocons/clients reckon/systems/ocons/clients
RUN git add . && bash -l -c "nix build ./reckon/systems/ocons/clients"
# Build build server
ADD ./reckon/systems/ocons/ocons-src reckon/systems/ocons/ocons-src
RUN git add . && bash -l -c "nix build -j auto ./reckon/systems/ocons/ocons-src"
# Add reckon code
ADD . .
ENV PYTHONPATH="/root:${PYTHONPATH}"
ENV SHELL=/bin/bash
# Make directory for logs
RUN mkdir -p /results/logs
# Add built artefacts
COPY --from=etcd-image /reckon/systems/etcd reckon/systems/etcd
COPY --from=zk-image /reckon/systems/zookeeper/bins reckon/systems/zookeeper/bins