Clamav dockerfile simplification

- Locked to specific release.
- Fewer layers.
- Size reduction of 49 MB.
master
TBK 2017-05-28 16:23:13 +02:00
parent 44e6948598
commit 2d0c4db2a5
1 changed files with 23 additions and 23 deletions

View File

@ -1,30 +1,30 @@
FROM alpine
FROM alpine:3.6
LABEL maintainer "https://m-ko.de Markus Kosmal <code@cnfg.io>"
RUN apk add -U --no-cache clamav clamav-libunrar clamav-daemon bash curl
# Add scripts
COPY dl_files.sh bootstrap.sh ./
# initial update of av databases
COPY dl_files.sh /dl_files.sh
RUN chmod +x /dl_files.sh
# Install Dependencies
RUN apk add --update \
&& apk add --no-cache clamav clamav-libunrar curl bash \
\
# Update AV databases
&& chmod +x dl_files.sh \
&& set -ex; /dl_files.sh \
\
# Setup run
&& mkdir /run/clamav \
&& chown clamav:clamav /run/clamav \
&& chmod 750 /run/clamav \
\
# AV configuration
&& sed -i '/Foreground yes/s/^#//g' /etc/clamav/clamd.conf \
&& sed -i '/TCPSocket 3310/s/^#//g' /etc/clamav/clamd.conf \
&& sed -i '/Foreground yes/s/^#//g' /etc/clamav/freshclam.conf
# pre-download defintions
RUN set -ex; \
/dl_files.sh && \
apk del curl
# permission juggling
RUN mkdir -p /run/clamav && \
chown clamav:clamav /run/clamav && \
chmod 750 /run/clamav
# av configuration update
RUN sed -i 's/^Foreground .*$/Foreground true/g' /etc/clamav/clamd.conf && \
echo "TCPSocket 3310" >> /etc/clamav/clamd.conf && \
sed -i 's/^Foreground .*$/Foreground true/g' /etc/clamav/freshclam.conf
# port provision
# Port provision
EXPOSE 3310
# av daemon bootstrapping
COPY bootstrap.sh /
# AV daemon bootstrapping
CMD ["/bootstrap.sh"]