2017-02-07 20:11:19 -06:00
|
|
|
FROM docker-config-engine
|
2016-10-25 20:52:13 -05:00
|
|
|
|
2017-02-09 00:02:21 -06:00
|
|
|
COPY [ \
|
2017-01-19 14:19:21 -06:00
|
|
|
{% for deb in docker_snmp_sv2_debs.split(' ') -%}
|
2017-02-09 00:02:21 -06:00
|
|
|
"debs/{{ deb }}",
|
|
|
|
{%- endfor %} \
|
|
|
|
"/debs/"]
|
2017-01-19 14:19:21 -06:00
|
|
|
|
2017-03-30 13:51:05 -05:00
|
|
|
# Install Python SwSSSDK (SNMP subagent dependency)
|
2018-01-17 19:11:31 -06:00
|
|
|
COPY python-wheels/sonic_platform_common-*-py3-*.whl /python-wheels/
|
2017-03-30 13:51:05 -05:00
|
|
|
COPY python-wheels/swsssdk-*-py3-*.whl /python-wheels/
|
2017-02-09 00:02:21 -06:00
|
|
|
COPY python-wheels/asyncsnmp-*-py3-*.whl /python-wheels/
|
2016-10-25 20:52:13 -05:00
|
|
|
|
|
|
|
# enable -O for all Python calls
|
|
|
|
ENV PYTHONOPTIMIZE 1
|
|
|
|
|
2017-02-16 23:48:49 -06:00
|
|
|
## Make apt-get non-interactive
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2017-02-09 00:02:21 -06:00
|
|
|
# install libsnmp30 dependencies
|
|
|
|
# install libpython3.6-dev dependencies
|
|
|
|
# install pip dependencies
|
|
|
|
# TODO: remove libpython3.6-dev, its and pip's dependencies if we can get pip3 directly
|
2016-10-25 20:52:13 -05:00
|
|
|
# install subagent
|
2017-02-09 00:02:21 -06:00
|
|
|
# clean up
|
2017-05-08 17:43:31 -05:00
|
|
|
RUN apt-get update && apt-get install -y libperl5.20 libpci3 libwrap0 \
|
2017-02-09 00:02:21 -06:00
|
|
|
libexpat1-dev \
|
|
|
|
curl gcc && \
|
|
|
|
dpkg -i \
|
|
|
|
{% for deb in docker_snmp_sv2_debs.split(' ') -%}
|
|
|
|
debs/{{ deb }}{{' '}}
|
|
|
|
{%- endfor %} && \
|
|
|
|
rm -rf /debs && \
|
|
|
|
curl https://bootstrap.pypa.io/get-pip.py | python3.6 && \
|
|
|
|
python3.6 -m pip install --no-cache-dir /python-wheels/*py3*.whl hiredis && \
|
2016-12-05 13:12:19 -06:00
|
|
|
rm -rf /python-wheels && \
|
2017-02-09 00:02:21 -06:00
|
|
|
python3.6 -m sonic_ax_impl install && \
|
|
|
|
apt-get -y purge libpython3.6-dev libexpat1-dev curl gcc && \
|
|
|
|
apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y --purge && \
|
2016-10-25 20:52:13 -05:00
|
|
|
find / | grep -E "__pycache__" | xargs rm -rf && \
|
|
|
|
rm -rf ~/.cache
|
|
|
|
|
2017-05-08 17:43:31 -05:00
|
|
|
COPY ["start.sh", "/usr/bin/"]
|
|
|
|
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
2017-02-18 19:50:29 -06:00
|
|
|
COPY ["*.j2", "/usr/share/sonic/templates/"]
|
2016-10-25 20:52:13 -05:00
|
|
|
|
2017-05-08 17:43:31 -05:00
|
|
|
## Although exposing ports is not needed for host net mode, keep it for possible bridge mode
|
2016-10-25 20:52:13 -05:00
|
|
|
EXPOSE 161/udp 162/udp
|
|
|
|
|
2017-05-08 17:43:31 -05:00
|
|
|
ENTRYPOINT ["/usr/bin/supervisord"]
|