-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
64 lines (51 loc) · 1.97 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
# Use an official runtime as a parent image
FROM ubuntu:16.04
# Stop script if any individual command fails.
RUN set -e
# Define LLVM version.
ENV llvm_version=6.0.0
# Define dependencies.
ENV lib_deps="make g++ git zlib1g-dev libncurses5-dev libssl-dev libpcre2-dev zip vim libevent-dev libcurl4-openssl-dev libprotobuf-dev"
ENV build_deps="wget xz-utils cmake python autoconf ocaml automake autoconf libtool protobuf-compiler debhelper"
# SVF ENV variables
ENV LLVM_DIR=/home/user/llvm
ENV PATH=${LLVM_DIR}/bin:${PATH}
# Fetch dependencies.
RUN apt-get update
RUN apt-get install -y $build_deps $lib_deps
RUN adduser cosmix-user
# Fetch LLVM+CLANG
WORKDIR /home/user
RUN wget "http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz"
RUN tar xvf "clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz"
RUN mv "clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04" "llvm"
RUN rm "clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz"
# Fetch SGX SDK for SUVM mstore
WORKDIR /home/user
RUN mkdir -p dev
WORKDIR /home/user/dev
RUN wget "https://download.01.org/intel-sgx/linux-2.6/ubuntu16.04-server/sgx_linux_x64_sdk_2.6.100.51363.bin"
RUN echo "no" > temp && echo "/home/user/dev" >> temp
RUN mkdir -p /home/user/dev/sgxsdk
RUN chmod +x ./sgx_linux_x64_sdk_2.6.100.51363.bin
RUN ./sgx_linux_x64_sdk_2.6.100.51363.bin < temp
# Fetch COSMIX
WORKDIR /home/user/dev
RUN git clone "https://github.com/acsl-technion/cosmix"
WORKDIR /home/user/dev/cosmix
# Build SVF
RUN git submodule update --init
WORKDIR /home/user/dev/cosmix/SVF
RUN git checkout SVF-1.5
RUN sed -i '2i\set(CMAKE_POSITION_INDEPENDENT_CODE ON)' CMakeLists.txt
RUN mkdir Release-build
WORKDIR /home/user/dev/cosmix/SVF/Release-build
RUN cmake ../
RUN make -j4
# Build CoSMIX
WORKDIR /home/user/dev/cosmix
RUN sed -i 's/\/opt\/intel/\/home\/user\/dev/g' Defines.mk
RUN make
RUN echo "COSMIX image constructed succesfully, to enter image run"
RUN echo "docker run -it cosmix /bin/bash"
RUN echo ".2" > /dev/null && git pull