2019-06-22 13:26:23 -05:00
|
|
|
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
2016-07-26 14:01:58 -05:00
|
|
|
FROM docker-syncd-mlnx
|
|
|
|
|
|
|
|
## Make apt-get non-interactive
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2019-07-03 12:37:55 -05:00
|
|
|
RUN apt-get purge -y syncd
|
|
|
|
|
2019-06-22 13:26:23 -05:00
|
|
|
{% if docker_syncd_mlnx_rpc_debs.strip() -%}
|
|
|
|
# Copy locally-built Debian package dependencies
|
|
|
|
{{ copy_files("debs/", docker_syncd_mlnx_rpc_debs.split(' '), "/debs/") }}
|
2017-03-24 20:36:56 -05:00
|
|
|
|
2019-06-22 13:26:23 -05:00
|
|
|
# Install locally-built Debian packages and implicitly install their dependencies
|
|
|
|
{{ install_debian_packages(docker_syncd_mlnx_rpc_debs.split(' ')) }}
|
|
|
|
{% endif %}
|
2019-02-05 00:06:37 -06:00
|
|
|
|
2019-06-22 13:26:23 -05:00
|
|
|
{% if docker_syncd_mlnx_rpc_pydebs.strip() -%}
|
|
|
|
# Copy locally-built Debian package dependencies
|
|
|
|
{{ copy_files("python-debs/", docker_syncd_mlnx_rpc_pydebs.split(' '), "/debs/") }}
|
2017-03-24 20:36:56 -05:00
|
|
|
|
2019-06-22 13:26:23 -05:00
|
|
|
# Install locally-built Debian packages and implicitly install their dependencies
|
|
|
|
{{ install_debian_packages(docker_syncd_mlnx_rpc_pydebs.split(' ')) }}
|
|
|
|
{% endif %}
|
2016-09-09 19:53:41 -05:00
|
|
|
|
2016-07-26 14:01:58 -05:00
|
|
|
## Pre-install the fundamental packages
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get -y install \
|
|
|
|
net-tools \
|
|
|
|
python-pip \
|
|
|
|
build-essential \
|
|
|
|
libssl-dev \
|
|
|
|
libffi-dev \
|
|
|
|
python-dev \
|
|
|
|
wget \
|
|
|
|
cmake \
|
|
|
|
&& 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 \
|
|
|
|
&& cmake . \
|
|
|
|
&& make install \
|
|
|
|
&& ldconfig \
|
|
|
|
&& cd .. \
|
|
|
|
&& rm -fr nanomsg-1.0.0 \
|
2016-09-09 19:53:41 -05:00
|
|
|
&& rm -f 1.0.0.tar.gz \
|
2016-09-15 18:14:34 -05:00
|
|
|
&& pip install cffi==1.7.0 \
|
|
|
|
&& pip install --upgrade cffi==1.7.0 \
|
2016-07-26 14:01:58 -05:00
|
|
|
&& pip install nnpy \
|
|
|
|
&& mkdir -p /opt \
|
|
|
|
&& cd /opt \
|
2016-09-09 19:53:41 -05:00
|
|
|
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \
|
|
|
|
&& apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \
|
2017-04-20 16:37:09 -05:00
|
|
|
&& rm -rf /root/deps
|
2016-07-26 14:01:58 -05:00
|
|
|
|
2017-05-08 17:43:31 -05:00
|
|
|
COPY ["ptf_nn_agent.conf", "/etc/supervisor/conf.d/"]
|
2019-06-22 13:26:23 -05:00
|
|
|
|
2019-07-03 12:37:55 -05:00
|
|
|
## Clean up
|
|
|
|
RUN apt-get clean -y && \
|
|
|
|
apt-get autoclean -y && \
|
|
|
|
apt-get autoremove -y && \
|
|
|
|
rm -rf /debs
|
|
|
|
|
2017-05-08 17:43:31 -05:00
|
|
|
ENTRYPOINT ["/usr/bin/supervisord"]
|