Merge pull request #318 from TBK0000/clamav-alpine

Clamav dockerfile simplification
master
André Peters 2017-05-28 19:51:35 +02:00 committed by GitHub
commit 5176ee4bac
2 changed files with 24 additions and 23 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ data/conf/postfix/sql
data/conf/dovecot/sql
data/web/inc/vars.local.inc.php
data/assets/ssl
.vscode/*

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"]