Files
docker_clamav/Dockerfile
2024-02-01 14:36:07 +01:00

34 lines
993 B
Docker

FROM python:3-alpine as builder
RUN apk add -u --no-cache clamav clamav-dev freshclam bash clamav-libunrar
RUN pip install fangfrisch
RUN mkdir -m 0770 -p /var/lib/fangfrisch
RUN chgrp clamav /var/lib/fangfrisch
ADD fangfrisch.conf /etc/fangfrisch.conf
USER clamav
RUN fangfrisch --conf /etc/fangfrisch.conf initdb
RUN fangfrisch --conf /etc/fangfrisch.conf refresh
RUN freshclam
FROM alpine
ARG PUID=1001
ARG PGID=1001
MAINTAINER tabledevil
RUN apk add -u --no-cache clamav bash clamav-libunrar
COPY --from=builder /var/lib/clamav /var/lib/clamav
#add startscript
ADD start.sh /start.sh
RUN chmod +x /start.sh
#customize clamav config
RUN sed -ie 's/#DetectPUA yes/DetectPUA yes/p' /etc/clamav/clamd.conf
RUN sed -ie 's/#AlertOLE2Macros yes/AlertOLE2Macros yes/p' /etc/clamav/clamd.conf
#
RUN chown root /usr/bin/freshclam
RUN chmod u+s /usr/bin/freshclam
#add user
RUN addgroup -g ${PGID} user && \
adduser -D -u ${PUID} -G user user
ENTRYPOINT ["/start.sh"]
CMD ["shell"]
USER user