2016-10-25 20:52:13 -05:00
|
|
|
FROM docker-base
|
|
|
|
|
2016-12-23 17:22:06 -06:00
|
|
|
COPY debs /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}" && \
|
|
|
|
apt-get -y purge build-essential wget libssl-dev openssl && \
|
|
|
|
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
|
|
|
|
|
|
|
|
## Although exposing ports is not need for host net mode, keep it for possible bridge mode
|
|
|
|
EXPOSE 161/udp 162/udp
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/supervisord"]
|