-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
84 lines (74 loc) · 2.38 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
72
73
74
75
76
77
78
79
80
81
82
83
84
FROM ubuntu:14.04
# Inspired by klee's docker file
# FIXME: Docker doesn't currently offer a way to
# squash the layers from within a Dockerfile so
# the resulting image is unnecessarily large!
ENV LLVM_VERSION=3.6
# TODO: This command is currently borrowed from klee's
# Dockerfile, it seems to provide all the necessary that
# we need in order to build coreutils.
RUN apt-get update && \
apt-get -y --no-install-recommends install \
clang-${LLVM_VERSION} \
llvm-${LLVM_VERSION} \
llvm-${LLVM_VERSION}-dev \
llvm-${LLVM_VERSION}-runtime \
llvm \
libcap-dev \
git \
subversion \
cmake \
make \
libboost-program-options-dev \
python3 \
python3-dev \
python3-pip \
perl \
flex \
bison \
libncurses-dev \
zlib1g-dev \
patch \
wget \
unzip \
libedit-dev \
binutils && \
pip3 install -U lit tabulate && \
update-alternatives --install /usr/bin/python python /usr/bin/python3 50
# Extra dependencies needed by coreutils
RUN apt-get -y --no-install-recommends install \
autoconf \
automake \
autopoint \
gettext \
gperf \
texinfo \
rsync \
xz-utils
# Create ``llvm-coreutils`` user for container with password ``llvm-coreutils``.
# and give it password-less sudo access (temporarily so we can use the TravisCI scripts)
RUN useradd -m llvm-coreutils && \
echo llvm-coreutils:llvm-coreutils | chpasswd && \
cp /etc/sudoers /etc/sudoers.bak && \
echo 'llvm-coreutils ALL=(root) NOPASSWD: ALL' >> /etc/sudoers
USER llvm-coreutils
WORKDIR /home/llvm-coreutils
RUN git clone git://git.sv.gnu.org/coreutils
WORKDIR /home/llvm-coreutils/coreutils
# I remember it was merely impossible to build a newer version of coreutils in Ubuntu 14.04
RUN git checkout v8.21
RUN export CC=clang-3.6 && \
export CXX=clang++-3.6 && \
export RANLIB=llvm-ranlib-3.6 && \
export AR=llvm-ar-3.6 && \
export CFLAGS=" -flto -std=gnu99 " && \
export LDFLAGS=" -flto -fuse-ld=gold -Wl,-plugin-opt=save-temps " && \
./bootstrap && \
./configure && \
make
# Revoke password-less sudo and Set up sudo access for the ``klee`` user so it
# requires a password
USER root
RUN mv /etc/sudoers.bak /etc/sudoers && \
echo 'llvm-coreutils ALL=(root) ALL' >> /etc/sudoers
USER llvm-coreutils