Dockerfile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. # 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 && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends \
  10. clamav-daemon \
  11. clamav-freshclam \
  12. libclamunrar7 \
  13. && rm -rf /var/lib/apt/lists/*
  14. # initial update of av databases
  15. COPY dl_files.sh /dl_files.sh
  16. RUN chmod +x /dl_files.sh
  17. RUN set -ex; \
  18. \
  19. fetchDeps=' \
  20. curl \
  21. '; \
  22. apt-get update; \
  23. apt-get install -y --no-install-recommends $fetchDeps; \
  24. rm -rf /var/lib/apt/lists/*; \
  25. /dl_files.sh \
  26. apt-get purge -y --auto-remove $fetchDeps
  27. # permission juggling
  28. RUN mkdir /var/run/clamav && \
  29. chown clamav:clamav /var/run/clamav && \
  30. chmod 750 /var/run/clamav
  31. # av configuration update
  32. RUN sed -i 's/^Foreground .*$/Foreground true/g' /etc/clamav/clamd.conf && \
  33. echo "TCPSocket 3310" >> /etc/clamav/clamd.conf && \
  34. sed -i 's/^Foreground .*$/Foreground true/g' /etc/clamav/freshclam.conf
  35. # port provision
  36. EXPOSE 3310
  37. # av daemon bootstrapping
  38. COPY bootstrap.sh /
  39. CMD ["/bootstrap.sh"]