2017-05-18 18:54:48 -05:00
|
|
|
FROM ubuntu:16.04
|
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
RUN apt-get update
|
|
|
|
RUN apt-get install -y \
|
|
|
|
openssh-server \
|
|
|
|
gcc \
|
|
|
|
vim \
|
|
|
|
make \
|
|
|
|
git \
|
|
|
|
sudo \
|
|
|
|
python \
|
|
|
|
python-dev \
|
|
|
|
python-cffi \
|
|
|
|
libffi-dev \
|
|
|
|
libssl-dev \
|
|
|
|
sshpass \
|
|
|
|
libxml2 \
|
|
|
|
libxslt1-dev \
|
2018-01-18 17:35:38 -06:00
|
|
|
python-setuptools \
|
|
|
|
build-essential \
|
2019-07-30 12:19:48 -05:00
|
|
|
curl \
|
|
|
|
cmake \
|
|
|
|
tcpdump \
|
2020-02-05 03:08:27 -06:00
|
|
|
snmp \
|
2020-04-12 15:35:28 -05:00
|
|
|
python-scapy \
|
|
|
|
inetutils-ping \
|
|
|
|
telnet
|
2017-05-18 18:54:48 -05:00
|
|
|
|
2017-07-19 10:10:45 -05:00
|
|
|
# For JNLP launcher
|
2017-05-18 18:54:48 -05:00
|
|
|
RUN apt-get install -y default-jre
|
|
|
|
|
|
|
|
# For syslog test
|
|
|
|
RUN apt-get install -y rsyslog psmisc
|
|
|
|
|
2017-06-26 23:28:51 -05:00
|
|
|
# Remove cffi 1.5.2, will install 1.10.0 by pip later
|
2019-04-29 19:21:24 -05:00
|
|
|
RUN apt-get purge -y python-cffi python-cffi-backend
|
2018-06-29 10:39:12 -05:00
|
|
|
# Remove pycparser 2.14, will install >=2.17 by pip later
|
2019-04-29 19:21:24 -05:00
|
|
|
RUN apt-get purge -y python-ply python-pycparser
|
2017-06-26 23:28:51 -05:00
|
|
|
|
2017-05-18 18:54:48 -05:00
|
|
|
RUN easy_install pip
|
|
|
|
|
|
|
|
RUN pip install ipaddr \
|
|
|
|
lxml \
|
|
|
|
netaddr \
|
|
|
|
natsort \
|
|
|
|
six \
|
|
|
|
pexpect \
|
|
|
|
pyasn1==0.1.9 \
|
2017-05-20 12:37:59 -05:00
|
|
|
pysnmp==4.2.5 \
|
2017-06-13 21:16:43 -05:00
|
|
|
jinja2==2.7.2 \
|
2017-06-26 23:28:51 -05:00
|
|
|
cffi==1.10.0 \
|
2019-04-13 11:48:56 -05:00
|
|
|
paramiko==2.1.2 \
|
2019-07-30 12:19:48 -05:00
|
|
|
passlib \
|
|
|
|
ipython==5.4.1 \
|
2020-03-30 19:50:57 -05:00
|
|
|
virtualenv \
|
2020-04-12 15:35:28 -05:00
|
|
|
"cryptography>=2.5" \
|
|
|
|
"future>=0.16.0" \
|
|
|
|
gitpython \
|
|
|
|
jsonpatch \
|
|
|
|
netmiko==2.4.2 \
|
|
|
|
prettytable \
|
|
|
|
psutil \
|
|
|
|
pycryptodome \
|
|
|
|
pyfiglet \
|
|
|
|
pylint==1.8.1 \
|
|
|
|
pyro4 \
|
|
|
|
pytest-repeat \
|
|
|
|
pytest-xdist==1.28.0 \
|
|
|
|
pytest==4.6.5 \
|
|
|
|
redis \
|
|
|
|
requests \
|
|
|
|
rpyc \
|
|
|
|
tabulate \
|
|
|
|
textfsm \
|
2020-05-05 20:40:20 -05:00
|
|
|
ixnetwork-restpy==1.0.52 \
|
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
|
|
|
|
|
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
|
|
|
|
2019-04-10 14:23:59 -05:00
|
|
|
# Install pytest-ansible module
|
2020-01-31 06:38:46 -06:00
|
|
|
RUN pip install wheel==0.33.6
|
2019-11-20 00:52:29 -06:00
|
|
|
RUN pip install pytest-ansible==2.2.2
|
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 %}
|
|
|
|
|
2019-11-20 00:52:29 -06:00
|
|
|
RUN pip install ansible==2.8.7
|
2017-05-18 18:54:48 -05:00
|
|
|
|
2020-01-12 15:53:52 -06:00
|
|
|
RUN pip install pysubnettree
|
|
|
|
|
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
|
|
|
# Install Azure CLI
|
|
|
|
WORKDIR /var/$user
|
|
|
|
RUN curl -L https://aka.ms/InstallAzureCliBundled -o azure-cli_bundle.tar.gz
|
|
|
|
RUN tar -xvzf azure-cli_bundle.tar.gz
|
|
|
|
RUN azure-cli_bundle_*/installer
|
|
|
|
|
2018-04-24 02:14:19 -05:00
|
|
|
# Known bug: azure keyvault cannot work behind a proxy
|
|
|
|
# Temporary fix: upgrade the azure-keyvault package within az cli
|
2018-08-08 20:29:17 -05:00
|
|
|
# TODO: if azure-cli contains newer version azure-keyvault, remove this
|
|
|
|
RUN ~/lib/azure-cli/bin/python -m pip install azure-keyvault==0.3.7 -U
|
2018-04-24 02:14:19 -05:00
|
|
|
|
2020-03-30 19:50:57 -05:00
|
|
|
# Install Virtual Environment
|
2020-04-04 20:17:55 -05:00
|
|
|
RUN python -m virtualenv --system-site-packages env-201811
|
2020-03-30 19:50:57 -05:00
|
|
|
RUN env-201811/bin/pip install ansible==2.0.0.2
|
|
|
|
|
2018-01-18 17:35:38 -06:00
|
|
|
RUN git clone https://github.com/Azure/sonic-mgmt
|