1 # docker file for creating a container that has nfvbench installed and ready to use
5 ENV VM_IMAGE_VER "0.12"
6 ENV PYTHONIOENCODING "utf8"
8 # Note: do not clone with --depth 1 as it will cause pbr to fail extracting the nfvbench version
11 RUN apt-get update && apt-get install -y software-properties-common
13 RUN add-apt-repository -y ppa:deadsnakes/ppa
15 RUN apt-get update && apt-get install -y \
25 && ln -s /usr/bin/python3.6 /usr/local/bin/python3 \
26 && mkdir -p /opt/trex/$TREX_VER \
27 && mkdir /var/log/nfvbench \
29 && wget --no-cache https://github.com/cisco-system-traffic-generator/trex-core/archive/$TREX_VER.tar.gz \
30 && tar xzf $TREX_VER.tar.gz --strip-components=1 -C /tmp/trex \
31 && rm -f /$TREX_VER.tar.gz \
32 && cp -a /tmp/trex/scripts/automation/trex_control_plane/interactive/trex /usr/local/lib/python3.6/dist-packages/ \
33 && cp -a /tmp/trex/scripts/* /opt/trex/$TREX_VER/ \
34 && rm -rf /opt/trex/$TREX_VER/automation/trex_control_plane/interactive/trex \
36 && wget https://bootstrap.pypa.io/get-pip.py \
37 && python3 get-pip.py \
38 && pip3 install -U pbr \
39 && pip3 install -U setuptools \
41 && git clone https://gerrit.opnfv.org/gerrit/nfvbench \
42 && cd /nfvbench && pip3 install -e . \
43 && wget -O nfvbenchvm-$VM_IMAGE_VER.qcow2 http://artifacts.opnfv.org/nfvbench/images/nfvbenchvm_centos-$VM_IMAGE_VER.qcow2 \
44 # Override Xtesting testcases.yaml file by NFVbench default one
45 && cp xtesting/testcases.yaml /usr/local/lib/python3.6/dist-packages/xtesting/ci/testcases.yaml \
46 && python3 ./docker/cleanup_generators.py \
47 && rm -rf /nfvbench/.git \
48 && apt-get remove -y wget git \
49 && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/*
51 ENV TREX_EXT_LIBS "/opt/trex/$TREX_VER/external_libs"
54 ENTRYPOINT ["/nfvbench/docker/nfvbench-entrypoint.sh"]