From 50919b751a4da8b8dd6377900f4de1ba65eaabc9 Mon Sep 17 00:00:00 2001 From: Enzo Candotti Date: Tue, 9 Aug 2022 00:11:27 -0300 Subject: [PATCH] Add stx-snmp docker image This change reorganizes the source directories of the stx-snmp container to be reused by both CentOS and Debian Dockerfiles in order to build the images having the corresponding OS-specic base. Test plan: PASS: Debian - Build Debian docker image and upload/apply snmp app changing the stx-snmp references to point to the new image. Verified that the app is applied, and the container is created. PASS: Verified common snmp scenarios: - test snmpwalk for 2c and 3 snmp version - test snmpget for 2c and 3 snmp version - verified traps are working as expected. PASS: CentOS - Same tests have been done building a CentOS container. Story: 2009831 Task: 45732 Signed-off-by: Enzo Candotti Change-Id: I7ecd52c1ad60ab1e82cb50805b71e772e3b93ec4 --- .../docker/stx-snmp/Dockerfile.debian | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/stx-snmp-helm/docker/stx-snmp/Dockerfile.debian b/stx-snmp-helm/docker/stx-snmp/Dockerfile.debian index e69de29..f562af3 100755 --- a/stx-snmp-helm/docker/stx-snmp/Dockerfile.debian +++ b/stx-snmp-helm/docker/stx-snmp/Dockerfile.debian @@ -0,0 +1,22 @@ +FROM debian AS builder +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get -y update +RUN apt-get -y install\ + snmp snmpd snmptrapd \ + libsnmp-dev \ + gcc \ + make \ + uuid-dev +RUN ln -s /usr/lib/libuuid.so.1.3.0 /usr/lib/libuuid.so +WORKDIR /home +COPY ./src/* /home/src/ +WORKDIR /home/src/ +RUN make -f Makefile + +FROM builder AS deployment-env +COPY ./mibs/* /usr/share/snmp/mibs/ +COPY --from=builder /home/src/libsnmpAuditPlugin.so /usr/lib/ +EXPOSE 161/udp +EXPOSE 162/udp +EXPOSE 705/tcp +CMD /usr/sbin/snmpd $OPTIONDEBUG -f