NFVBENCH-130 Upgrade to TRex v2.54
[nfvbench.git] / docker / Dockerfile
1 # docker file for creating a container that has nfvbench installed and ready to use
2 FROM ubuntu:16.04
3
4 ENV TREX_VER "v2.54"
5 ENV VM_IMAGE_VER "0.6"
6
7 # Note: do not clone with --depth 1 as it will cause pbr to fail extracting the nfvbench version
8 # from the git tag
9
10 # Trex v2.54:
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 
14
15 RUN apt-get update && apt-get install -y \
16        git \
17        kmod \
18        pciutils \
19        python \
20        python-pip \
21        vim \
22        wget \
23        net-tools \
24        iproute2 \
25        libelf1 \
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 \
41        && cd / \
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/*
49
50 ENV TREX_EXT_LIBS "/opt/trex/$TREX_VER/external_libs"
51
52
53 ENTRYPOINT ["/nfvbench/docker/nfvbench-entrypoint.sh"]