aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorLadue, David (dl3158) <dl3158@att.com>2020-02-14 12:02:30 -0500
committerLadue, David (dl3158) <dl3158@att.com>2020-03-02 11:20:48 -0500
commit9c9a86fe301431ca353f8c249164a854db9399e0 (patch)
tree9a4171fd2fd31ee5312e1b83c1266673ca7c97b1 /Dockerfile
parent1578ce3e4f0b95babd93cbfa193fe5492bf4591e (diff)
copyright banner changes2.0.3
Change-Id: I64f089e36fb8b21ed1719696ceeded1590ba8f8c Signed-off-by: Ladue, David (dl3158) <dl3158@att.com> Issue-ID: DCAEGEN2-2068 Signed-off-by: Ladue, David (dl3158) <dl3158@att.com>
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile32
1 files changed, 24 insertions, 8 deletions
diff --git a/Dockerfile b/Dockerfile
index f3c7ecb..6a79013 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,35 +1,51 @@
-# Use an official Python runtime as a base image
-FROM python:3.6
+# Use an official pypy runtime as a base image
+FROM pypy:3
ENV INSROOT /opt/app
ENV APPUSER snmptrap
ENV APPDIR ${INSROOT}/${APPUSER}
+# add group and user: ubuntu
RUN useradd -d ${APPDIR} ${APPUSER}
+#
+# add group and user: ubuntu - for when DCAE platform evolves and runs as NON-ROOT!!!
+# RUN addgroup -g 1000 -S ${APPUSER} && \
+# adduser -u 1000 -S ${APPUSER} -G ${APPUSER}
WORKDIR ${APPDIR}
-EXPOSE 162:162/udp
+EXPOSE 162:6162/udp
# Copy the current directory contents into the container at ${APPDIR}
COPY ./snmptrap/ ./bin/
COPY ./etc/ ./etc/
COPY requirements.txt ./
-RUN pip install -r requirements.txt
+#
+# RUN pip install -r requirements.txt
+RUN pip install --trusted-host files.pythonhosted.org -r requirements.txt
+
+RUN mkdir -p /etc \
+ && mkdir -p /etc/apt
+RUN apt-get update -y && apt-get install -y jq bc vim
RUN mkdir -p ${APPDIR}/data \
&& mkdir -p ${APPDIR}/logs \
&& mkdir -p ${APPDIR}/tmp \
- && chown -R ${APPUSER}:${APPUSER} ${APPDIR} \
+# && chown -R ${APPUSER}:${APPUSER} ${APPDIR} \
&& chmod a+w ${APPDIR}/data \
&& chmod a+w ${APPDIR}/logs \
&& chmod a+w ${APPDIR}/tmp \
&& chmod 500 ${APPDIR}/etc \
- && chmod 500 ${APPDIR}/bin/snmptrapd.sh
+ && chmod 500 ${APPDIR}/bin/snmptrapd.sh \
+ && chmod 500 ${APPDIR}/bin/scheduler.sh \
+# && ln -s /usr/bin/python3 /usr/bin/python \
+ && rm ${APPDIR}/requirements.txt
-USER ${APPUSER}
+# run everything from here on as $APPUSER, NOT ROOT!
+#USER ${APPUSER}
+# map logs directory to external volume
VOLUME ${APPDIR}/logs
-# Run run_policy.sh when the container launches
+# launch container
CMD ["./bin/snmptrapd.sh", "start"]