-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
51 lines (48 loc) · 2.67 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM ubuntu:18.04
ARG TARFILE=latest
RUN apt-get update -qy && apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
bash bash-completion bsdtar bzip2 cpio curl ethtool gettext gettext \
git git iproute2 iputils-ping jq libedit-dev libffi-dev libgmp-dev \
libncurses5-dev libpython-dev libssl-dev libssl-dev libtool \
linux-headers-generic locales lsof make net-tools netcat-openbsd \
patch pciutils perl-modules python python-dev python-ipaddr python-pip \
python3 python3-dev python3-pip python3-venv sudo tidy util-linux wget \
xsltproc xutils-dev zlib1g-dev && \
echo en_US.UTF-8 UTF-8 >> /etc/locale.gen && \
locale-gen && \
python3 -m pip install -U coverage cryptography lxml nose pylint \
pytest pyyaml ryu tox twine wheel \
dpkt jsonrpclib-pelix pyyaml pyzmq-ctypes repoze.lru scapy simple_enum simpy texttable && \
python2 -m pip install -U coverage cryptography lxml nose pylint \
pytest pyyaml ryu tox twine wheel \
dpkt jsonrpclib-pelix pyyaml pyzmq-ctypes repoze.lru scapy simple_enum simpy texttable
COPY wait-for*.sh /usr/bin/
WORKDIR /trex
COPY ${TARFILE} .
RUN tar -xzf ${TARFILE} --strip-components=1 && rm ${TARFILE}
RUN tar -xf trex_client*.tar.gz && \
# silly expectation of trex
cp -pr trex_client/external_libs /usr/local && \
# Python2.7
(cp -pr trex_client/interactive/trex_stl_lib /usr/local/lib/python2.7/dist-packages || \
cp -pr trex_client/stl/trex_stl_lib /usr/local/lib/python2.7/dist-packages) && \
cp -pr trex_client/stf/trex_stf_lib /usr/local/lib/python2.7/dist-packages && \
cp -pr trex_client/external_libs/trex-openssl /usr/local/lib/python2.7/dist-packages && \
# Python3.6
(cp -pr trex_client/interactive/trex_stl_lib /usr/local/lib/python3.6/dist-packages || \
cp -pr trex_client/stl/trex_stl_lib /usr/local/lib/python3.6/dist-packages) && \
cp -pr trex_client/stf/trex_stf_lib /usr/local/lib/python3.6/dist-packages && \
cp -pr trex_client/external_libs/trex-openssl /usr/local/lib/python3.6/dist-packages && \
# Python3.7
mkdir -p /usr/local/lib/python3.7/dist-packages && \
(cp -pr trex_client/interactive/trex_stl_lib /usr/local/lib/python3.7/dist-packages || \
cp -pr trex_client/stl/trex_stl_lib /usr/local/lib/python3.7/dist-packages) && \
cp -pr trex_client/stf/trex_stf_lib /usr/local/lib/python3.7/dist-packages && \
cp -pr trex_client/external_libs/trex-openssl /usr/local/lib/python3.7/dist-packages && \
# Cleanup image
rm trex_client*.tar.gz && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
EXPOSE 4500 4501 8090