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-02-09 00:02:21 -06:00
|
|
|
COPY python-wheels/sswsdk-*-py3-*.whl /python-wheels/
|
|
|
|
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 supervisor
|
|
|
|
# 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
|
|
|
|
RUN apt-get update && apt-get install -y supervisor \
|
|
|
|
libperl5.20 libpci3 libwrap0 \
|
|
|
|
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
|
|
|
|
|
|
|
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
2017-02-18 19:50:29 -06:00
|
|
|
COPY ["*.j2", "/usr/share/sonic/templates/"]
|
2017-01-19 22:56:26 -06:00
|
|
|
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-02-09 00:02:21 -06:00
|
|
|
ENTRYPOINT /usr/bin/config.sh && /usr/bin/supervisord
|