sonic-buildimage/dockers/docker-snmp-sv2/Dockerfile.j2
Joe LeVeque 8f348399f5 [Dockers]: Manage all Docker containers with Supervisord (#573)
- Consolidate config.sh and start.sh scripts into one script (start.sh)
 - Solve issue #435 - All dockers now run supervisord as their ENTRYPOINT
 - All stdout/stderr output from processes managed by supervisord is now sent to syslog instead of their own files
 - Supervisord log messages are now also sent to syslog
 - Removed unused smartmontools package from docker-platform-monitor
2017-05-08 15:43:31 -07:00

51 lines
1.6 KiB
Django/Jinja

FROM docker-config-engine
COPY [ \
{% for deb in docker_snmp_sv2_debs.split(' ') -%}
"debs/{{ deb }}",
{%- endfor %} \
"/debs/"]
# Install Python SwSSSDK (SNMP subagent dependency)
COPY python-wheels/swsssdk-*-py3-*.whl /python-wheels/
COPY python-wheels/asyncsnmp-*-py3-*.whl /python-wheels/
# enable -O for all Python calls
ENV PYTHONOPTIMIZE 1
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
# 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
# install subagent
# clean up
RUN apt-get update && apt-get install -y 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 && \
rm -rf /python-wheels && \
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 && \
find / | grep -E "__pycache__" | xargs rm -rf && \
rm -rf ~/.cache
COPY ["start.sh", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["*.j2", "/usr/share/sonic/templates/"]
## Although exposing ports is not needed for host net mode, keep it for possible bridge mode
EXPOSE 161/udp 162/udp
ENTRYPOINT ["/usr/bin/supervisord"]