1 # docker file for creating a container that has nfvbench installed and ready to use
7 # Note: do not clone with --depth 1 as it will cause pbr to fail extracting the nfvbench version
11 # workaround a problem when using --unbind-unused-ports with t-rex-64
12 # instead patch t-rex-64 directly to add --unbind-unused-ports when calling ./trex-cfg
13 # so that the new arg is not passed to _t-rex-64
15 RUN apt-get update && apt-get install -y \
26 && mkdir -p /opt/trex \
27 && mkdir /var/log/nfvbench \
28 && wget --no-cache https://trex-tgn.cisco.com/trex/release/$TREX_VER.tar.gz \
29 && tar xzf $TREX_VER.tar.gz -C /opt/trex \
30 && rm -f /$TREX_VER.tar.gz \
31 && rm -f /opt/trex/$TREX_VER/trex_client_$TREX_VER.tar.gz \
32 && cp -a /opt/trex/$TREX_VER/automation/trex_control_plane/interactive/trex /usr/local/lib/python2.7/dist-packages/ \
33 && rm -rf /opt/trex/$TREX_VER/automation/trex_control_plane/interactive/trex \
34 && sed -i -e "s/2048 /512 /" -e "s/2048\"/512\"/" /opt/trex/$TREX_VER/trex-cfg \
35 && sed -i -e "s/trex-cfg/trex-cfg --unbind-unused-ports/" /opt/trex/$TREX_VER/t-rex-64 \
36 && apt-get remove -y python-pip \
37 && wget https://bootstrap.pypa.io/get-pip.py \
38 && python get-pip.py \
39 && pip install -U pbr \
40 && pip install -U setuptools \
42 && git clone https://gerrit.opnfv.org/gerrit/nfvbench \
43 && cd /nfvbench && pip install -e . \
44 && wget -O nfvbenchvm-$VM_IMAGE_VER.qcow2 http://artifacts.opnfv.org/nfvbench/images/nfvbenchvm_centos-$VM_IMAGE_VER.qcow2 \
45 && python ./docker/cleanup_generators.py \
46 && rm -rf /nfvbench/.git \
47 && apt-get remove -y wget git \
48 && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/*
50 ENV TREX_EXT_LIBS "/opt/trex/$TREX_VER/external_libs"
53 ENTRYPOINT ["/nfvbench/docker/nfvbench-entrypoint.sh"]