-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-base
37 lines (26 loc) · 1.08 KB
/
Dockerfile-base
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
FROM ubuntu:16.04
RUN apt-get update && apt-get install --no-install-recommends -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 libsaxonb-java openjdk-8-jre-headless \
bc wget && \
rm -rf /var/lib/apt/lists/*
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