Dockerfile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. FROM debian:latest
  2. MAINTAINER https://m-ko.de Markus Kosmal <code@cnfg.io>
  3. # Debian Base to use
  4. ENV DEBIAN_VERSION jessie
  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. wget && \
  15. apt-get clean && \
  16. rm -rf /var/lib/apt/lists/*
  17. # initial update of av databases
  18. RUN wget -O /var/lib/clamav/main.cvd http://db.local.clamav.net/main.cvd && \
  19. wget -O /var/lib/clamav/daily.cvd http://db.local.clamav.net/daily.cvd && \
  20. wget -O /var/lib/clamav/bytecode.cvd http://db.local.clamav.net/bytecode.cvd && \
  21. chown clamav:clamav /var/lib/clamav/*.cvd
  22. # permission juggling
  23. RUN mkdir /var/run/clamav && \
  24. chown clamav:clamav /var/run/clamav && \
  25. chmod 750 /var/run/clamav
  26. # av configuration update
  27. RUN sed -i 's/^Foreground .*$/Foreground true/g' /etc/clamav/clamd.conf && \
  28. echo "TCPSocket 3310" >> /etc/clamav/clamd.conf && \
  29. sed -i 's/^Foreground .*$/Foreground true/g' /etc/clamav/freshclam.conf
  30. # volume provision
  31. VOLUME ["/var/lib/clamav"]
  32. # port provision
  33. EXPOSE 3310
  34. # av daemon bootstrapping
  35. COPY bootstrap.sh /
  36. CMD ["/bootstrap.sh"]