Cleanup requirements & tox config, update pylint
[nfvbench.git] / docker / Dockerfile
1 # docker file for creating a container that has nfvbench installed and ready to use
2 FROM ubuntu:20.04
3
4 ENV TREX_VER "v2.89"
5 ENV VM_IMAGE_VER "0.15"
6 ENV PYTHONIOENCODING "utf8"
7
8 RUN apt-get update && apt-get install -y \
9        git \
10        kmod \
11        pciutils \
12        python3.8 \
13        vim \
14        wget \
15        net-tools \
16        iproute2 \
17        libelf1 \
18        python3-dev \
19        libpython3.8-dev \
20        python3-distutils \
21        gcc \
22        && ln -s /usr/bin/python3.8 /usr/local/bin/python3 \
23        && mkdir -p /opt/trex \
24        && mkdir /var/log/nfvbench \
25        && wget --no-cache --no-check-certificate https://trex-tgn.cisco.com/trex/release/$TREX_VER.tar.gz \
26        && tar xzf $TREX_VER.tar.gz -C /opt/trex \
27        && rm -f /$TREX_VER.tar.gz \
28        && rm -f /opt/trex/$TREX_VER/trex_client_$TREX_VER.tar.gz \
29        && cp -a /opt/trex/$TREX_VER/automation/trex_control_plane/interactive/trex /usr/local/lib/python3.8/dist-packages/ \
30        && rm -rf /opt/trex/$TREX_VER/automation/trex_control_plane/interactive/trex \
31        && wget https://bootstrap.pypa.io/get-pip.py \
32        && python3 get-pip.py \
33        && pip3 install -U pbr \
34        && pip3 install -U setuptools \
35        && cd /opt \
36        # Note: do not clone with --depth 1 as it will cause pbr to fail extracting the nfvbench version
37        # from the git tag
38        && git clone https://gerrit.opnfv.org/gerrit/nfvbench \
39        && cd nfvbench && pip3 install -e . \
40        && wget -O nfvbenchvm-$VM_IMAGE_VER.qcow2 http://artifacts.opnfv.org/nfvbench/images/nfvbenchvm_centos-$VM_IMAGE_VER.qcow2 \
41        # Override Xtesting testcases.yaml file by NFVbench default one
42        && cp xtesting/testcases.yaml /usr/local/lib/python3.8/dist-packages/xtesting/ci/testcases.yaml \
43        && python3 ./docker/cleanup_generators.py \
44        && rm -rf /opt/nfvbench/.git \
45        # Symlink for retrocompatibility 4.x
46        && ln -s /opt/nfvbench /nfvbench \
47        && apt-get remove -y wget git python3-dev libpython3.8-dev gcc \
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 ["/opt/nfvbench/docker/nfvbench-entrypoint.sh"]