From e80de6ef39054eac1e51d58fd5f29926093d57ed Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Tue, 9 Jan 2024 12:43:08 +0200 Subject: [PATCH] fix: Massage the build so the scenarios can run Fixes #121 --- sim/Dockerfile | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/sim/Dockerfile b/sim/Dockerfile index 10f6c08..9b93482 100644 --- a/sim/Dockerfile +++ b/sim/Dockerfile @@ -4,7 +4,7 @@ ARG TARGETARCH RUN echo "TARGETARCH : $TARGETARCH" RUN apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y python3 build-essential cmake wget + DEBIAN_FRONTEND=noninteractive apt-get install -y python3 build-essential cmake wget ninja-build ENV NS_VERS 3.40 RUN wget -O ns3.tar.bz2 https://www.nsnam.org/release/ns-allinone-$NS_VERS.tar.bz2 @@ -19,7 +19,6 @@ WORKDIR /ns3 RUN mkdir out/ RUN ./ns3 configure --build-profile=release --out=out/ -RUN ./ns3 build # make including of the QuicNetworkSimulatorHelper class possible COPY CMakeLists.patch . @@ -29,9 +28,12 @@ RUN rm -r scratch/subdir scratch/scratch-simulator.cc COPY scenarios scratch/ # compile all the scenarios -RUN ./ns3 build && \ - cd out/lib && du -sh . && strip -v * && du -sh . && cd ../.. && \ - cd out/scratch && rm -r subdir ns$NS_VERS-scratch-simulator* +RUN ./ns3 build + +# strip ns3 version prefix from scratches +RUN find out/scratch -name "ns${NS_VERS}-*" | \ + sed -e 'p' -E -e "s|ns${NS_VERS}-*||g" | \ + xargs -n2 mv ENV PATH="/go/bin:${PATH}" COPY wait-for-it-quic /wait-for-it-quic @@ -44,15 +46,11 @@ RUN apt-get update && \ apt-get clean WORKDIR /ns3 -COPY --from=builder /ns3/out/src/fd-net-device/* /ns3/src/fd-net-device/ +COPY --from=builder /ns3/out/src/fd-net-device/* /ns3/out/src/fd-net-device/ COPY --from=builder /ns3/out/scratch/*/* /ns3/scratch/ -COPY --from=builder /ns3/out/lib/ /ns3/lib +COPY --from=builder /ns3/out/lib/ /ns3/out/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 chmod +x run.sh RUN mkdir /logs