NFVBENCH-160 xtesting integration
[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.61"
5 ENV VM_IMAGE_VER "0.12"
6 ENV PYTHONIOENCODING "utf8"
7
8 # Note: do not clone with --depth 1 as it will cause pbr to fail extracting the nfvbench version
9 # from the git tag
10
11 RUN apt-get update && apt-get install -y software-properties-common
12
13 RUN add-apt-repository -y ppa:deadsnakes/ppa
14
15 RUN apt-get update && apt-get install -y \
16        git \
17        kmod \
18        pciutils \
19        python3.6 \
20        vim \
21        wget \
22        net-tools \
23        iproute2 \
24        libelf1 \
25        && ln -s /usr/bin/python3.6 /usr/local/bin/python3 \
26        && mkdir -p /opt/trex/$TREX_VER \
27        && mkdir /var/log/nfvbench \
28        && mkdir /tmp/trex \
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 \
35        && rm -rf /tmp/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 \
40        && cd / \
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/*
50
51 ENV TREX_EXT_LIBS "/opt/trex/$TREX_VER/external_libs"
52
53
54 ENTRYPOINT ["/nfvbench/docker/nfvbench-entrypoint.sh"]