Enzo Candotti c7d206abbf Update Debian base image to version 11
An update on the Debian container specified as 'debian' produced that
some packages like libpython2.7 and postgresql-13 were not found,
causing the daily builds to fail.

This commit specifies the version to be used as a base image in order to
fix that problem.

Test Plan:
PASS: Build stx-snmp, stx-fm-trap-subagent and stx-fm-subagent. Verify
all the containers can be built properly.

Closes-Bug: 2023703

Signed-off-by: Enzo Candotti <enzo.candotti@windriver.com>
Change-Id: Ic4a2c69ea97ecfea3463c09d6de1b5c9dcdde6d3
2023-06-14 00:42:15 -03:00

42 lines
1.1 KiB
Docker

ARG BASE
FROM ${BASE} AS stx
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update
RUN apt-get -y install\
fm-common \
fm-common-dev
FROM debian:11 AS base
RUN apt-get -y update
RUN apt-get -y install\
snmp snmpd snmptrapd \
libpython2.7 \
python3 python3-dev python3-setuptools python-is-python3 \
postgresql-13 \
libsnmp-dev \
libjson-c-dev \
gcc \
make \
uuid-dev
WORKDIR /home/sub-agent
COPY --from=stx /usr/lib/libfmcommon.so.1.0 /usr/lib/
RUN ln -s /usr/lib/libfmcommon.so.1.0 /usr/lib/libfmcommon.so
RUN ln -s /usr/lib/libfmcommon.so.1.0 /usr/lib/libfmcommon.so.1
RUN ln -s /usr/lib/libuuid.so.1.3.0 /usr/lib/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/lib/
RUN make
FROM base AS deployment-env
COPY --from=base /home/sub-agent/snmpSubAgent .
COPY bootstrap.sh .
RUN chmod 755 bootstrap.sh
ENTRYPOINT ["./bootstrap.sh"]