2017-02-07 20:11:19 -06:00
|
|
|
FROM docker-config-engine
|
2016-10-25 20:52:13 -05:00
|
|
|
|
2017-01-19 14:19:21 -06:00
|
|
|
COPY \
|
|
|
|
{% for deb in docker_snmp_sv2_debs.split(' ') -%}
|
|
|
|
debs/{{ deb }}{{' '}}
|
|
|
|
{%- endfor -%}
|
|
|
|
debs/
|
|
|
|
|
2016-12-05 13:12:19 -06:00
|
|
|
COPY python-wheels /python-wheels
|
2016-10-25 20:52:13 -05:00
|
|
|
|
|
|
|
# enable -O for all Python calls
|
|
|
|
ENV PYTHONOPTIMIZE 1
|
|
|
|
|
|
|
|
## Pre-install the fundamental packages
|
|
|
|
## Install Python SSWSDK (SNMP subagent dependency)
|
|
|
|
## Install SNMP subagent
|
|
|
|
## Clean up
|
2016-12-05 13:12:19 -06:00
|
|
|
RUN apt-get update && apt-get install -y libmysqlclient-dev libmysqld-dev libperl-dev libpci-dev libpci3 libsensors4 libsensors4-dev libwrap0-dev
|
|
|
|
|
2016-12-23 17:22:06 -06:00
|
|
|
RUN dpkg -i \
|
|
|
|
{% for deb in docker_snmp_sv2_debs.split(' ') -%}
|
|
|
|
debs/{{ deb }}{{' '}}
|
|
|
|
{%- endfor %}
|
2016-12-05 13:12:19 -06:00
|
|
|
|
2016-12-23 17:22:06 -06:00
|
|
|
RUN rm -rf /debs
|
2016-10-25 20:52:13 -05:00
|
|
|
|
|
|
|
# install subagent
|
|
|
|
RUN apt-get -y install build-essential wget libssl-dev openssl supervisor && \
|
|
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
|
|
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz && \
|
|
|
|
tar xvf Python-3.5.2.tgz && cd Python-3.5.2 && \
|
|
|
|
./configure --without-doc-strings --prefix=/usr --without-pymalloc --enable-shared && \
|
|
|
|
make && make install && \
|
|
|
|
ldconfig && \
|
|
|
|
cd .. && rm -rf Python-3.5.2 && rm Python-3.5.2.tgz && \
|
2016-12-05 13:12:19 -06:00
|
|
|
pip3 install --no-cache-dir /python-wheels/*py3*.whl hiredis && \
|
|
|
|
rm -rf /python-wheels && \
|
2016-10-25 20:52:13 -05:00
|
|
|
python3 -m sonic_ax_impl install && \
|
|
|
|
python3 -m pip uninstall -y pip setuptools && \
|
|
|
|
/bin/bash -c "rm -rf /usr/lib/python3.5/{unittest,lib2to3,tkinter,idlelib,email,test}" && \
|
2017-01-21 12:30:39 -06:00
|
|
|
apt-get -y purge build-essential libssl-dev openssl && \
|
2016-10-25 20:52:13 -05:00
|
|
|
apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y && \
|
|
|
|
find / | grep -E "__pycache__" | xargs rm -rf && \
|
|
|
|
rm -rf ~/.cache
|
|
|
|
|
|
|
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
2017-01-19 22:56:26 -06:00
|
|
|
COPY ["*.j2", "/etc/swss/snmp/"]
|
|
|
|
COPY ["snmpd", "/etc/default/"]
|
|
|
|
COPY ["config.sh", "/usr/bin/"]
|
2016-10-25 20:52:13 -05:00
|
|
|
|
|
|
|
## Although exposing ports is not need for host net mode, keep it for possible bridge mode
|
|
|
|
EXPOSE 161/udp 162/udp
|
|
|
|
|
2017-01-19 22:56:26 -06:00
|
|
|
ENTRYPOINT /usr/bin/config.sh && /usr/bin/supervisord
|