Dockerfile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. FROM debian:stretch-slim
  2. LABEL maintainer "https://m-ko.de Markus Kosmal <code@cnfg.io>"
  3. # Debian Base to use
  4. ENV DEBIAN_VERSION stretch
  5. ARG DEBIAN_FRONTEND=noninteractive
  6. # initial install of av daemon
  7. RUN echo "deb http://http.debian.net/debian/ $DEBIAN_VERSION main contrib non-free" > /etc/apt/sources.list && \
  8. echo "deb http://http.debian.net/debian/ $DEBIAN_VERSION-updates main contrib non-free" >> /etc/apt/sources.list && \
  9. echo "deb http://security.debian.org/ $DEBIAN_VERSION/updates main contrib non-free" >> /etc/apt/sources.list && \
  10. apt-get update && apt-get install -y -qq --no-install-recommends \
  11. clamav-daemon \
  12. clamav-freshclam \
  13. libclamunrar7 \
  14. && rm -rf /var/lib/apt/lists/*
  15. # initial update of av databases
  16. COPY dl_files.sh /dl_files.sh
  17. RUN chmod +x /dl_files.sh
  18. RUN set -ex; \
  19. \
  20. fetchDeps=' \
  21. curl \
  22. '; \
  23. apt-get update; \
  24. apt-get install -y --no-install-recommends $fetchDeps; \
  25. rm -rf /var/lib/apt/lists/*; \
  26. /dl_files.sh \
  27. apt-get purge -y --auto-remove $fetchDeps
  28. # permission juggling
  29. RUN mkdir /var/run/clamav && \
  30. chown clamav:clamav /var/run/clamav && \
  31. chmod 750 /var/run/clamav
  32. # av configuration update
  33. RUN sed -i 's/^Foreground .*$/Foreground true/g' /etc/clamav/clamd.conf && \
  34. echo "TCPSocket 3310" >> /etc/clamav/clamd.conf && \
  35. sed -i 's/^Foreground .*$/Foreground true/g' /etc/clamav/freshclam.conf
  36. # port provision
  37. EXPOSE 3310
  38. # av daemon bootstrapping
  39. COPY bootstrap.sh /
  40. CMD ["/bootstrap.sh"]