FIX: Docker build

Signed-off-by: Sebastian Waldbauer <waldbauer@cert.at>
This commit is contained in:
Sebastian Waldbauer
2022-01-31 16:12:41 +01:00
parent 39c3f9c571
commit 251f61d419
2 changed files with 19 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
FROM debian:bullseye
FROM debian:bullseye-slim
ENV LANG C.UTF-8
ARG BUILD_DATE
@@ -14,13 +14,8 @@ LABEL maintainer="IntelMQ Team <intelmq-team@cert.at>" \
org.opencontainers.image.documentation="https://intelmq.readthedocs.io/en/latest/" \
org.opencontainers.image.vendor="intelmq-team"
###
# libfuzzy-dev is used for pydeep
#
#
#
#
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
sudo \
@@ -46,33 +41,36 @@ LABEL org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.version=$BUILD_VERSION
WORKDIR /opt
COPY ./intelmq /opt/intelmq
COPY ./intelmq-api /opt/intelmq-api
COPY ./intelmq /etc/intelmq
COPY ./intelmq-api /etc/intelmq-api
RUN useradd -d /etc/intelmq -U -s /bin/bash intelmq \
RUN useradd -d /opt/intelmq -U -s /bin/bash intelmq \
&& adduser intelmq sudo \
&& echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
&& sudo chown -R intelmq:intelmq /etc/intelmq \
&& echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /opt/sudoers \
&& sudo chown -R intelmq:intelmq /opt/intelmq \
&& mkdir -p /opt/intelmq_persistence \
&& sudo chown -R intelmq:intelmq /opt/intelmq_persistence
### Install IntelMQ
RUN cd /etc/intelmq \
&& pip3 install hug url-normalize geolib imbox jinja2 pyasn textx tld time-machine otxv2 \
&& pip3 install --force pymisp[fileobjects,openioc,virustotal] \
&& pip3 install --no-cache-dir -e . \
RUN pip3 install hug url-normalize geolib imbox jinja2 pyasn textx tld time-machine otxv2 \
&& pip3 install --force pymisp[fileobjects,openioc,virustotal]
RUN cd /opt/intelmq \
&& pip3 install .
RUN cd /opt/intelmq \
&& intelmqsetup
### Install IntelMQ-API
RUN cd /etc/intelmq-api \
RUN cd /opt/intelmq-api \
&& python3 setup.py install
ADD entrypoint.sh /opt/entrypoint.sh
RUN chmod +x /opt/entrypoint.sh \
&& chown intelmq:intelmq /opt/entrypoint.sh
USER intelmq:intelmq
WORKDIR /opt
#USER intelmq:intelmq
ENTRYPOINT [ "/opt/entrypoint.sh" ]

View File

@@ -14,7 +14,7 @@ intelmq-api-adduser --user "$intelmq_user" --password "$intelmq_pass"
if [[ $1 == "selftest" ]]
then
export INTELMQ_TEST_EXOTIC=1
nosetests3 /etc/intelmq/intelmq/tests
nosetests3 /opt/intelmq/intelmq/tests
else
cd /etc/intelmq-api && hug -m intelmq_api.serve -p8080
cd /opt/intelmq-api && hug -m intelmq_api.serve -p8080
fi