2017-04-21 03:13:41 +08:00
|
|
|
FROM debian:stretch-slim
|
2017-05-13 21:33:32 +08:00
|
|
|
LABEL maintainer "https://m-ko.de Markus Kosmal <code@cnfg.io>"
|
2017-02-22 05:26:20 +08:00
|
|
|
|
|
|
|
# Debian Base to use
|
2017-04-21 03:13:41 +08:00
|
|
|
ENV DEBIAN_VERSION stretch
|
2017-05-13 22:29:18 +08:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
2017-02-22 05:26:20 +08:00
|
|
|
|
|
|
|
# initial install of av daemon
|
|
|
|
RUN echo "deb http://http.debian.net/debian/ $DEBIAN_VERSION main contrib non-free" > /etc/apt/sources.list && \
|
2017-05-13 02:54:23 +08:00
|
|
|
echo "deb http://http.debian.net/debian/ $DEBIAN_VERSION-updates main contrib non-free" >> /etc/apt/sources.list && \
|
|
|
|
echo "deb http://security.debian.org/ $DEBIAN_VERSION/updates main contrib non-free" >> /etc/apt/sources.list && \
|
2017-05-13 22:29:18 +08:00
|
|
|
apt-get update && apt-get install -y -qq --no-install-recommends \
|
2017-05-13 02:54:23 +08:00
|
|
|
clamav-daemon \
|
|
|
|
clamav-freshclam \
|
2017-05-13 22:07:06 +08:00
|
|
|
libclamunrar7 \
|
2017-05-13 21:52:16 +08:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2017-02-22 05:26:20 +08:00
|
|
|
|
|
|
|
# initial update of av databases
|
2017-04-21 03:13:41 +08:00
|
|
|
COPY dl_files.sh /dl_files.sh
|
|
|
|
RUN chmod +x /dl_files.sh
|
2017-05-13 22:28:23 +08:00
|
|
|
|
|
|
|
RUN set -ex; \
|
|
|
|
\
|
|
|
|
fetchDeps=' \
|
|
|
|
curl \
|
|
|
|
'; \
|
|
|
|
apt-get update; \
|
|
|
|
apt-get install -y --no-install-recommends $fetchDeps; \
|
|
|
|
rm -rf /var/lib/apt/lists/*; \
|
|
|
|
/dl_files.sh \
|
|
|
|
apt-get purge -y --auto-remove $fetchDeps
|
2017-02-22 05:26:20 +08:00
|
|
|
|
|
|
|
# permission juggling
|
|
|
|
RUN mkdir /var/run/clamav && \
|
2017-05-13 02:54:23 +08:00
|
|
|
chown clamav:clamav /var/run/clamav && \
|
|
|
|
chmod 750 /var/run/clamav
|
2017-02-22 05:26:20 +08:00
|
|
|
|
|
|
|
# av configuration update
|
|
|
|
RUN sed -i 's/^Foreground .*$/Foreground true/g' /etc/clamav/clamd.conf && \
|
2017-05-13 02:54:23 +08:00
|
|
|
echo "TCPSocket 3310" >> /etc/clamav/clamd.conf && \
|
|
|
|
sed -i 's/^Foreground .*$/Foreground true/g' /etc/clamav/freshclam.conf
|
2017-02-22 05:26:20 +08:00
|
|
|
|
|
|
|
# port provision
|
|
|
|
EXPOSE 3310
|
|
|
|
|
|
|
|
# av daemon bootstrapping
|
2017-03-07 22:44:37 +08:00
|
|
|
COPY bootstrap.sh /
|
2017-02-22 05:26:20 +08:00
|
|
|
CMD ["/bootstrap.sh"]
|