sonic-buildimage/dockers/docker-snmp-sv2/Dockerfile.j2

52 lines
1.7 KiB
Docker
Raw Normal View History

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 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
# install subagent
# 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 && \
Build improvements (#80) * Build improvements Fix dependencies Add configuration options Automatically build sonic-slave * Set default number of jobs to 1 * Auto generate target/debs directory Signed-off-by: marian-pritsak <marianp@mellanox.com> * Automatically remove sonic-slave container after exit * Silence clean-logs * Add SONIC_CLEAN_TARGETS to clean * Use second expansion for clean dependencies * Avoid creating empty log files Remove log file on flush instead of writing empty string * Put dpkg install inside lock Use same lock as debian install targets do to avoid race condition in dpkg installation * Remove redirect to log from docker save * Add .platform dependency to all and clean targets * Remove header and footer from clean targets * Disable messages for SONIC_CLEAN_TARGETS * Exit with error if dpkg-buildpackage fails * Set new location for debs in build_debian.sh * Add recipe for docker-database * Update redis version to 3.2.4 * Add support for p4 platform * Add recipe for snmpd * Add slave targets to phony and make all target default * Remove build.sh from thrift * Add versioning to team, nl, hiredis and initramfs * Change sonic-slave to support snmpd build from sources * Remove src/tenjin * Add recipe for lldpd * Add recipe for mpdecimal * Remove hiredis directory on rebuild * Add recipe for Mellanox hw management * Remove generic image from all targets for Mellanox * Add support for python wheels * Add lldp and snmp dockers * Sync docker-database to include libjemalloc * Fix asyncsnmp variable name * Change default build configuration Redirect output to log files by default Set number of jobs to nproc value Do not print dependencies Fix logging to print log of failed job into console * Use docker inspect to check if sonic-slave image exists * Use config in slave.mk directly * Disable color output by default * Remove sswsdk dependency from lldp and snmp dockers * Fix comment in py wheels install targets * Add dependency between two versions of sswsdk * Add containers to mellanox platform lldp, snmp and database containers * Add recipe for team docker * Add team docker to mellanox platform * Encrypt password passed to build_debian.sh * Update mellanox SAI version Make version and revision setting only in main recipe * Fix error handling in makefiles As makefiles use .ONESHELL we should add -e option to shell options in order to exit after any command fails * Add recipe for platform monitor image * Add platfotm monitor to mellanox targets * Ignore submodules when building base image
2016-12-05 13:12:19 -06:00
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 supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY ["*.j2", "/usr/share/sonic/templates/"]
COPY ["config.sh", "/usr/bin/"]
## Although exposing ports is not need for host net mode, keep it for possible bridge mode
EXPOSE 161/udp 162/udp
ENTRYPOINT /usr/bin/config.sh && /usr/bin/supervisord