diff options
author | vagrant <vv770d@att.com> | 2018-01-20 15:12:44 +0000 |
---|---|---|
committer | vagrant <vv770d@att.com> | 2018-01-20 15:12:59 +0000 |
commit | 00bd7aa1794a71388cb323f524926958e0dd25c7 (patch) | |
tree | df95ef01901b8960d2fb821d961fe04a32b940d1 /Dockerfile | |
parent | 4ddc91766c1d252be8d78bf26133dccce82886c2 (diff) |
snmptrap collector dockerization
Issue-ID: DCAEGEN2-228
Change-Id: I118a4c62452a53f647fc868c5cac9bd2b19730ae
Signed-off-by: Vijay VK <vv770d@att.com>
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e4806c3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +# Use an official Python runtime as a base image +FROM python:3.6 + +ENV INSROOT /opt/app +ENV APPUSER snmptrap +ENV APPDIR ${INSROOT}/${APPUSER} + +RUN useradd -d ${APPDIR} ${APPUSER} + +WORKDIR ${APPDIR} + +EXPOSE 162 + +# Copy the current directory contents into the container at ${APPDIR} +COPY ./src/ ./bin/ +COPY ./etc/ ./etc/ + +RUN mkdir -p ${APPDIR}/logs \ + && chown -R ${APPUSER}:${APPUSER} ${APPDIR} \ + && chmod a+w ${APPDIR}/logs \ + && chmod 500 ${APPDIR}/etc \ + && chmod 500 ${APPDIR}/bin/dcae_snmptrapd.sh + + +USER ${APPUSER} + +VOLUME ${APPDIR}/logs + +# Run run_policy.sh when the container launches +CMD ["./bin/dcae_snmptrapd.sh"] |