Enzo Candotti 90a317189a Add stx-fm-subagent docker image
This change reorganizes the source directories of the stx-fm-subagent
container to be reused by both CentOS and Debian Dockerfiles in order
to build the images having the corresponding OS-specic base.

The files Dockerfile.debian for stx-snmp and stx-fm-trap-subagent have
been added with no content in order to work on them on different
reviews.

Test plan:

PASS: Debian - Build Debian docker image and upload/apply snmp-app changing
the stx-fm-subagent 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: 45730

Signed-off-by: Enzo Candotti <enzo.candotti@windriver.com>
Change-Id: Idfb46224429061f11493c111588b542cf809b79f
2022-07-29 12:36:46 +00:00

45 lines
1.0 KiB
Docker

ARG BASE
FROM ${BASE} AS stx
RUN yum -y update
RUN yum -y install\
fm-common \
fm-common-dev
FROM centos:7 AS base
RUN yum -y install\
net-snmp \
net-snmp-utils \
python3-setuptools \
libpython2.7 \
python3-devel \
postgresql
WORKDIR /home/sub-agent
COPY --from=stx /usr/lib64/libfmcommon.so.1.0 /usr/lib64/
RUN ln -s /usr/lib64/libfmcommon.so.1.0 /usr/lib64/libfmcommon.so
RUN ln -s /usr/lib64/libfmcommon.so.1.0 /usr/lib64/libfmcommon.so.1
FROM base AS builder
RUN yum -y install\
net-snmp-libs \
net-snmp-devel\
gcc \
make \
uuid
RUN ln -s /usr/lib64/libuuid.so.1.3.0 /usr/lib64/libuuid.so
COPY Makefile .
COPY ./src/* ./src/
COPY --from=stx /usr/include/fmDbAPI.h /usr/include/
COPY --from=stx /usr/include/fmAPI.h /usr/include/
ENV LIB_DIR=/usr/lib64/
RUN make
FROM base AS deployment-env
COPY --from=builder /home/sub-agent/snmpSubAgent .
COPY bootstrap.sh .
RUN chmod 755 bootstrap.sh
ENTRYPOINT ["./bootstrap.sh"]