2020-09-18 00:00:32 -05:00
|
|
|
FROM ubuntu:18.04
|
2017-05-18 18:54:48 -05:00
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2020-06-16 13:32:25 -05:00
|
|
|
RUN apt-get update && apt-get install -y build-essential \
|
|
|
|
cmake \
|
|
|
|
curl \
|
|
|
|
default-jre \
|
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
inetutils-ping \
|
2020-09-22 20:39:14 -05:00
|
|
|
iproute2 \
|
2020-09-23 22:01:58 -05:00
|
|
|
isc-dhcp-client \
|
2020-06-16 13:32:25 -05:00
|
|
|
libffi-dev \
|
|
|
|
libssl-dev \
|
|
|
|
libxml2 \
|
|
|
|
libxslt1-dev \
|
|
|
|
make \
|
|
|
|
openssh-server \
|
|
|
|
psmisc \
|
|
|
|
python \
|
|
|
|
python-dev \
|
|
|
|
python-scapy \
|
|
|
|
python-setuptools \
|
2020-09-18 00:00:32 -05:00
|
|
|
python-pip \
|
|
|
|
python3-pip \
|
|
|
|
python3-venv \
|
2020-06-16 13:32:25 -05:00
|
|
|
rsyslog \
|
|
|
|
snmp \
|
|
|
|
sshpass \
|
|
|
|
sudo \
|
|
|
|
tcpdump \
|
|
|
|
telnet \
|
|
|
|
vim
|
2017-06-26 23:28:51 -05:00
|
|
|
|
2020-06-16 13:32:25 -05:00
|
|
|
RUN pip install cffi==1.10.0 \
|
2021-06-28 19:15:03 -05:00
|
|
|
contextlib2==0.6.0.post1 \
|
2021-03-10 21:15:11 -06:00
|
|
|
cryptography==3.3.2 \
|
2020-04-12 15:35:28 -05:00
|
|
|
"future>=0.16.0" \
|
|
|
|
gitpython \
|
2020-06-16 13:32:25 -05:00
|
|
|
ipaddr \
|
|
|
|
ipython==5.4.1 \
|
2021-04-23 12:17:19 -05:00
|
|
|
ixnetwork-restpy==1.0.64 \
|
2021-04-29 14:31:46 -05:00
|
|
|
ixnetwork-open-traffic-generator==0.0.79 \
|
2021-04-15 10:24:31 -05:00
|
|
|
snappi[ixnetwork]==0.3.13 \
|
2020-06-16 13:32:25 -05:00
|
|
|
jinja2==2.7.2 \
|
2020-04-12 15:35:28 -05:00
|
|
|
jsonpatch \
|
2020-06-16 13:32:25 -05:00
|
|
|
lxml \
|
|
|
|
natsort \
|
|
|
|
netaddr \
|
2020-04-12 15:35:28 -05:00
|
|
|
netmiko==2.4.2 \
|
2020-06-16 13:32:25 -05:00
|
|
|
paramiko==2.7.1 \
|
|
|
|
passlib \
|
|
|
|
pexpect \
|
2020-04-12 15:35:28 -05:00
|
|
|
prettytable \
|
|
|
|
psutil \
|
2020-06-16 13:32:25 -05:00
|
|
|
pyasn1==0.1.9 \
|
2020-04-12 15:35:28 -05:00
|
|
|
pyfiglet \
|
|
|
|
pylint==1.8.1 \
|
|
|
|
pyro4 \
|
2020-06-16 13:32:25 -05:00
|
|
|
pysnmp==4.2.5 \
|
2020-04-12 15:35:28 -05:00
|
|
|
pytest-repeat \
|
2020-06-25 19:45:16 -05:00
|
|
|
pytest-html \
|
2020-04-12 15:35:28 -05:00
|
|
|
pytest-xdist==1.28.0 \
|
|
|
|
pytest==4.6.5 \
|
|
|
|
redis \
|
|
|
|
requests \
|
|
|
|
rpyc \
|
2020-06-16 13:32:25 -05:00
|
|
|
six \
|
2020-04-12 15:35:28 -05:00
|
|
|
tabulate \
|
|
|
|
textfsm \
|
2020-06-16 13:32:25 -05:00
|
|
|
virtualenv \
|
2019-07-30 12:19:48 -05:00
|
|
|
&& git clone https://github.com/p4lang/scapy-vxlan.git \
|
|
|
|
&& cd scapy-vxlan \
|
|
|
|
&& python setup.py install \
|
|
|
|
&& cd .. \
|
|
|
|
&& rm -fr scapy-vxlan \
|
|
|
|
&& wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
|
|
|
|
&& tar xvfz 1.0.0.tar.gz \
|
|
|
|
&& cd nanomsg-1.0.0 \
|
|
|
|
&& mkdir -p build \
|
|
|
|
&& cd build \
|
|
|
|
&& cmake .. \
|
|
|
|
&& make install \
|
|
|
|
&& ldconfig \
|
|
|
|
&& cd ../.. \
|
|
|
|
&& rm -fr nanomsg-1.0.0 \
|
|
|
|
&& rm -f 1.0.0.tar.gz \
|
|
|
|
&& pip install nnpy \
|
|
|
|
&& pip install dpkt
|
2017-05-18 18:54:48 -05:00
|
|
|
|
2019-12-10 20:03:55 -06:00
|
|
|
# Install docker-ce-cli
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y \
|
|
|
|
apt-transport-https \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
gnupg-agent \
|
|
|
|
software-properties-common \
|
|
|
|
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
|
|
|
|
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get install -y docker-ce-cli
|
|
|
|
|
2020-09-22 11:37:03 -05:00
|
|
|
# Install Azure CLI
|
|
|
|
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
|
|
|
|
|
2018-06-01 13:33:13 -05:00
|
|
|
# Install Microsoft Azure Kusto Library for Python
|
2018-10-11 18:36:00 -05:00
|
|
|
RUN pip install azure-kusto-data==0.0.13 \
|
|
|
|
azure-kusto-ingest==0.0.13
|
2017-07-19 10:10:45 -05:00
|
|
|
|
2020-01-31 06:38:46 -06:00
|
|
|
RUN pip install wheel==0.33.6
|
2019-04-10 14:23:59 -05:00
|
|
|
|
2017-07-19 10:10:45 -05:00
|
|
|
## Copy and install sonic-mgmt docker dependencies
|
|
|
|
COPY \
|
|
|
|
{% for deb in docker_sonic_mgmt_debs.split(' ') -%}
|
|
|
|
debs/{{ deb }}{{' '}}
|
|
|
|
{%- endfor -%}
|
|
|
|
debs/
|
|
|
|
|
|
|
|
RUN dpkg -i \
|
|
|
|
{% for deb in docker_sonic_mgmt_debs.split(' ') -%}
|
|
|
|
debs/{{ deb }}{{' '}}
|
|
|
|
{%- endfor %}
|
|
|
|
|
2020-06-12 01:23:27 -05:00
|
|
|
RUN pip install ansible==2.8.12
|
2017-05-18 18:54:48 -05:00
|
|
|
|
2020-01-12 15:53:52 -06:00
|
|
|
RUN pip install pysubnettree
|
|
|
|
|
2020-06-12 18:21:10 -05:00
|
|
|
# Install pytest-ansible module with 'become', 'become_user' parameters support
|
|
|
|
RUN git clone https://github.com/ansible/pytest-ansible.git \
|
|
|
|
&& cd pytest-ansible \
|
|
|
|
&& git checkout d33c025f070a9c870220a157cc5a999fda68de44 \
|
|
|
|
&& python setup.py install \
|
|
|
|
&& cd .. \
|
|
|
|
&& rm -fr pytest-ansible
|
|
|
|
|
2017-05-18 18:54:48 -05:00
|
|
|
RUN mkdir /var/run/sshd
|
|
|
|
EXPOSE 22
|
|
|
|
|
|
|
|
# Add user
|
|
|
|
ARG user
|
|
|
|
ARG uid
|
|
|
|
ARG guid
|
|
|
|
ARG hostname
|
|
|
|
|
|
|
|
ENV BUILD_HOSTNAME $hostname
|
|
|
|
ENV USER $user
|
2020-04-12 15:35:28 -05:00
|
|
|
ENV CC=gcc CPP=cpp CXX=c++ LDSHARED="gcc -pthread -shared" PYMSSQL_BUILD_WITH_BUNDLED_FREETDS=1
|
2017-05-18 18:54:48 -05:00
|
|
|
|
|
|
|
RUN groupadd -f -r -g $guid g$user
|
|
|
|
|
|
|
|
RUN useradd $user -l -u $uid -g $guid -d /var/$user -m -s /bin/bash
|
|
|
|
|
|
|
|
COPY sonic-jenkins.pub /var/$user/.ssh/authorized_keys2
|
|
|
|
|
|
|
|
RUN echo "Host *\n\tStrictHostKeyChecking no\n" > /var/$user/.ssh/config
|
|
|
|
RUN chown $user /var/$user/.ssh -R
|
|
|
|
RUN chmod go= /var/$user/.ssh -R
|
|
|
|
|
|
|
|
# Add user to sudoers
|
|
|
|
RUN echo "$user ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers
|
|
|
|
|
|
|
|
USER $user
|
2018-01-18 17:35:38 -06:00
|
|
|
WORKDIR /var/$user
|
2020-09-22 11:37:03 -05:00
|
|
|
|
|
|
|
# Add az symlink for backwards compatibility
|
|
|
|
RUN mkdir bin && ln -s /usr/bin/az bin/az
|
2018-04-24 02:14:19 -05:00
|
|
|
|
2020-09-18 00:00:32 -05:00
|
|
|
# Install Virtual Environments
|
2020-04-04 20:17:55 -05:00
|
|
|
RUN python -m virtualenv --system-site-packages env-201811
|
2021-03-10 21:15:11 -06:00
|
|
|
RUN env-201811/bin/pip install cryptography==3.3.2 ansible==2.0.0.2
|
2020-07-08 18:39:42 -05:00
|
|
|
|
2020-09-18 00:00:32 -05:00
|
|
|
RUN python3 -m venv env-python3
|
2021-04-27 01:38:16 -05:00
|
|
|
RUN env-python3/bin/pip3 install cryptography==3.3.2 azure-kusto-data azure-kusto-ingest defusedxml pytest aiohttp
|
2020-09-18 00:00:32 -05:00
|
|
|
|
2020-07-08 18:39:42 -05:00
|
|
|
# NOTE: There is an ordering dependency for pycryptodome. Leaving this at
|
|
|
|
# the end until we figure that out.
|
|
|
|
RUN pip install pycryptodome==3.9.8
|
2021-06-02 10:42:30 -05:00
|
|
|
|
|
|
|
# Install allure-pytest library
|
|
|
|
RUN pip install --upgrade setuptools \
|
|
|
|
&& pip install allure-pytest==2.8.22
|