Dockerfile 1.3 KB

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