Dockerfile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. FROM alpine:3.6
  2. LABEL maintainer "André Peters <andre.peters@servercow.de>"
  3. # Add scripts
  4. COPY dl_files.sh bootstrap.sh ./
  5. # Installation
  6. ENV CLAMAV 0.99.3
  7. RUN apk add --no-cache --virtual build-dependencies alpine-sdk ncurses-dev zlib-dev bzip2-dev pcre-dev linux-headers fts-dev libxml2-dev libressl-dev \
  8. && apk add --no-cache curl bash tini libxml2 libbz2 pcre fts libressl \
  9. && wget -O - https://www.clamav.net/downloads/production/clamav-${CLAMAV}.tar.gz | tar xfvz - \
  10. && cd clamav-${CLAMAV} \
  11. && LIBS=-lfts ./configure \
  12. --prefix=/usr \
  13. --libdir=/usr/lib \
  14. --sysconfdir=/etc/clamav \
  15. --mandir=/usr/share/man \
  16. --infodir=/usr/share/info \
  17. --without-iconv \
  18. --disable-llvm \
  19. --with-user=clamav \
  20. --with-group=clamav \
  21. --with-dbdir=/var/lib/clamav \
  22. --enable-clamdtop \
  23. --enable-bigstack \
  24. --with-pcre \
  25. && make -j4 \
  26. && make install \
  27. && make clean \
  28. && cd .. && rm -rf clamav-${CLAMAV} \
  29. && apk del build-dependencies \
  30. && addgroup -S clamav \
  31. && adduser -S -D -h /var/lib/clamav -s /sbin/nologin -G clamav -g clamav clamav \
  32. && mkdir -p /run/clamav \
  33. && chown clamav:clamav /run/clamav \
  34. && chmod +x /dl_files.sh \
  35. && set -ex; /bin/bash /dl_files.sh \
  36. && chmod 750 /run/clamav
  37. # Port provision
  38. EXPOSE 3310
  39. # AV daemon bootstrapping
  40. CMD ["/sbin/tini", "-g", "--", "/bootstrap.sh"]