blob: e4806c3d593192704efa3a6981179a075ec033c4 [file] [log] [blame]
vagrant00bd7aa2018-01-20 15:12:44 +00001# Use an official Python runtime as a base image
2FROM python:3.6
3
4ENV INSROOT /opt/app
5ENV APPUSER snmptrap
6ENV APPDIR ${INSROOT}/${APPUSER}
7
8RUN useradd -d ${APPDIR} ${APPUSER}
9
10WORKDIR ${APPDIR}
11
12EXPOSE 162
13
14# Copy the current directory contents into the container at ${APPDIR}
15COPY ./src/ ./bin/
16COPY ./etc/ ./etc/
17
18RUN mkdir -p ${APPDIR}/logs \
19 && chown -R ${APPUSER}:${APPUSER} ${APPDIR} \
20 && chmod a+w ${APPDIR}/logs \
21 && chmod 500 ${APPDIR}/etc \
22 && chmod 500 ${APPDIR}/bin/dcae_snmptrapd.sh
23
24
25USER ${APPUSER}
26
27VOLUME ${APPDIR}/logs
28
29# Run run_policy.sh when the container launches
30CMD ["./bin/dcae_snmptrapd.sh"]