-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-base.14.04
57 lines (44 loc) · 2.06 KB
/
Dockerfile-base.14.04
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
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y mercurial libexpat1-dev git-core build-essential bison \
flex libssl-dev libdb-dev libpcap-dev libc6-dbg libsysfs-dev gawk indent \
pkg-config autoconf automake sudo ccache software-properties-common \
libsaxonb-java openjdk-7-jre-headless bc wget \
valgrind vim && \
rm -rf /var/lib/apt/lists/*
# install g++-4.9
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test && apt-get update && \
apt-get install -y g++-4.9
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20 && \
rm /usr/bin/cpp && \
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-4.8 10 && \
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-4.9 20 && \
update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 && \
update-alternatives --set cc /usr/bin/gcc && \
update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30 && \
update-alternatives --set c++ /usr/bin/g++
RUN useradd -ms /bin/bash ns3dce && adduser ns3dce sudo && echo -n 'ns3dce:ns3dce' | chpasswd
# Enable passwordless sudo for users under the "sudo" group
RUN sed -i.bkp -e \
's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' \
/etc/sudoers
USER ns3dce
WORKDIR /home/ns3dce/
ENV PATH /usr/lib/ccache:${PATH}
# bake
RUN mkdir -p /home/ns3dce/dce-linux-dev
WORKDIR /home/ns3dce/dce-linux-dev
RUN git clone https://github.com/thehajime/bake
RUN ./bake/bake.py configure -e dce-linux-dev && \
./bake/bake.py download
WORKDIR /home/ns3dce/dce-linux-dev/source/ns-3-dev
COPY ns3.patch .
RUN git apply < ns3.patch
WORKDIR /home/ns3dce/dce-linux-dev
RUN ./bake/bake.py build -j $(nproc)
RUN cd source/ns-3-dce && ./test.py -v -c unit