-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathspectec.dockerfile
More file actions
70 lines (53 loc) · 1.98 KB
/
spectec.dockerfile
File metadata and controls
70 lines (53 loc) · 1.98 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
# --------------------------------------
# Stage 1: System dependencies
# --------------------------------------
FROM ubuntu:20.04 AS base
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y git make curl && \
apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /home
# --------------------------------------
# Stage 2: Clone repo
# --------------------------------------
FROM base AS source
RUN git clone https://github.com/kaist-plrg/p4cherry.git && \
cd p4cherry && \
git checkout p4spec-sl-mod-il && \
git submodule update --init --recursive
WORKDIR /home/p4cherry
# ---------------------------------------
# Stage 3: Installations - p4cherry/p4spec
# ---------------------------------------
FROM source AS opambase
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Seoul
RUN apt-get update && \
apt-get install -y opam libgmp-dev pkg-config && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Initialize opam
RUN opam init --disable-sandboxing --auto-setup && \
opam switch create 4.14.0 && \
eval $(opam env) && \
opam install dune menhir bignum core.v0.15.1 core_unix.v0.15.2 bisect_ppx -y
# Set opam environment permanently
ENV OPAM_SWITCH_PREFIX=/root/.opam/4.14.0
ENV PATH=$OPAM_SWITCH_PREFIX/bin:$PATH
ENV CAML_LD_LIBRARY_PATH=$OPAM_SWITCH_PREFIX/lib/stublibs:$OPAM_SWITCH_PREFIX/lib/ocaml/stublibs:$OPAM_SWITCH_PREFIX/lib/ocaml
# ---------------------------------------
# Stage 4: Build p4spec
# ---------------------------------------
FROM opambase AS p4specbase
RUN make build-spec && \
chmod a+x ./p4spectec
# --------------------------------------
# Stage 5: Fuzzer & Reducer dependencies
# --------------------------------------
FROM p4specbase AS reducebase
RUN apt-get update && \
apt-get install -y clang creduce python3 pip && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install psutil
COPY patches/creduce /usr/bin/creduce
RUN chmod +x /usr/bin/creduce
ENV P4CHERRY_PATH=/home/p4cherry