-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (45 loc) · 1.69 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
FROM ubuntu:20.04 AS builder
ARG TARGETPLATFORM
RUN echo "TARGETPLATFORM : $TARGETPLATFORM"
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y python3 build-essential cmake wget
ENV VERS 3.32
RUN wget https://www.nsnam.org/release/ns-allinone-$VERS.tar.bz2
RUN tar xjf ns-allinone-$VERS.tar.bz2 && rm ns-allinone-$VERS.tar.bz2
RUN mv /ns-allinone-$VERS/ns-$VERS /ns3
WORKDIR /ns3
RUN mkdir out/
RUN ./waf configure --build-profile=optimized --out=out/
RUN ./waf build
RUN cd / && \
wget https://dl.google.com/go/go1.15.linux-amd64.tar.gz && \
tar xfz go1.15.linux-amd64.tar.gz && \
rm go1.15.linux-amd64.tar.gz;
# make including of the QuicNetworkSimulatorHelper class possible
COPY wscript.patch .
RUN patch < wscript.patch
RUN rm -r scratch/subdir scratch/scratch-simulator.cc
COPY scenarios scratch/
# compile all the scenarios
RUN ./waf build && \
cd out/lib && du -sh . && strip -v * && du -sh . && cd ../.. && \
cd out/scratch && rm -r subdir helper scratch-simulator*
ENV PATH="/go/bin:${PATH}"
COPY wait-for-it-quic /wait-for-it-quic
RUN cd /wait-for-it-quic && go build .
FROM ubuntu:20.04
RUN apt-get update && \
apt-get install -y net-tools iptables tcpdump && \
apt-get clean
WORKDIR /ns3
COPY --from=builder /ns3/out/src/fd-net-device/* /ns3/src/fd-net-device/
COPY --from=builder /ns3/out/scratch/*/* /ns3/scratch/
COPY --from=builder /ns3/out/lib/ /ns3/lib
COPY --from=builder /wait-for-it-quic/wait-for-it-quic /usr/bin
# see https://gitlab.com/nsnam/ns-3-dev/issues/97
ENV PATH="/ns3/src/fd-net-device/:${PATH}"
ENV LD_LIBRARY_PATH="/ns3/lib"
COPY run.sh .
RUN sed -i 's/\r$//' run.sh && chmod +x run.sh
RUN mkdir /logs
ENTRYPOINT [ "./run.sh" ]