Remove folder scan and alerts
This commit is contained in:
parent
6e99b42c8c
commit
b1880a435c
1 changed files with 3 additions and 26 deletions
29
Dockerfile
29
Dockerfile
|
@ -3,11 +3,9 @@ FROM golang:alpine
|
||||||
# Update
|
# Update
|
||||||
RUN apk update upgrade;
|
RUN apk update upgrade;
|
||||||
|
|
||||||
# Set timezone to Singapore
|
# Set timezone to Europe/Zurich
|
||||||
RUN apk add tzdata
|
RUN apk add tzdata
|
||||||
RUN mv /etc/localtime /etc/localtime.utc && \
|
RUN ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime
|
||||||
ln -s /usr/share/zoneinfo/Asia/Singapore /etc/localtime
|
|
||||||
|
|
||||||
|
|
||||||
# Install ClamAV
|
# Install ClamAV
|
||||||
RUN apk --no-cache add clamav clamav-libunrar \
|
RUN apk --no-cache add clamav clamav-libunrar \
|
||||||
|
@ -19,36 +17,15 @@ RUN sed -i 's/^#Foreground .*$/Foreground true/g' /etc/clamav/clamd.conf \
|
||||||
&& sed -i 's/^#TCPSocket .*$/TCPSocket 3310/g' /etc/clamav/clamd.conf \
|
&& sed -i 's/^#TCPSocket .*$/TCPSocket 3310/g' /etc/clamav/clamd.conf \
|
||||||
&& sed -i 's/^#Foreground .*$/Foreground true/g' /etc/clamav/freshclam.conf
|
&& sed -i 's/^#Foreground .*$/Foreground true/g' /etc/clamav/freshclam.conf
|
||||||
|
|
||||||
|
RUN freshclam --quiet --no-dns --checks=2
|
||||||
# Configure scan alerts
|
|
||||||
RUN touch /var/log/clamav-infected.log && chmod 0777 /var/log/clamav-infected.log
|
|
||||||
COPY ./alert.sh /opt/clamav-utils/
|
|
||||||
RUN chmod -Rf 0755 /opt/clamav-utils/alert.sh
|
|
||||||
RUN sed -i 's:^#VirusEvent .*$:VirusEvent /opt/clamav-utils/alert.sh:g' /etc/clamd.d/scan.conf
|
|
||||||
|
|
||||||
|
|
||||||
# Configure ClamAV user, ScanOnAccess requires root
|
|
||||||
#RUN sed -i 's/^User .*$/User root/g' /etc/clamd.d/scan.conf
|
|
||||||
|
|
||||||
|
|
||||||
# ScanOnAccess configurations
|
|
||||||
RUN mkdir /scan-target
|
|
||||||
RUN sed -i 's/^#ScanOnAccess .*$/ScanOnAccess yes/g' /etc/clamav/clamd.conf \
|
|
||||||
&& sed -i 's:#OnAccessMountPath /home/user:&\r\nOnAccessMountPath /scan-target:g' /etc/clamav/clamd.conf
|
|
||||||
|
|
||||||
|
|
||||||
RUN freshclam -v --no-dns
|
|
||||||
# --quiet
|
|
||||||
|
|
||||||
# Build go package
|
# Build go package
|
||||||
ADD . /go/src/clamav-rest/
|
ADD . /go/src/clamav-rest/
|
||||||
RUN cd /go/src/clamav-rest && go build -v
|
RUN cd /go/src/clamav-rest && go build -v
|
||||||
|
|
||||||
|
|
||||||
COPY entrypoint.sh /usr/bin/
|
COPY entrypoint.sh /usr/bin/
|
||||||
RUN mv /go/src/clamav-rest/clamav-rest /usr/bin/ && rm -Rf /go/src/clamav-rest
|
RUN mv /go/src/clamav-rest/clamav-rest /usr/bin/ && rm -Rf /go/src/clamav-rest
|
||||||
|
|
||||||
|
|
||||||
EXPOSE 9000
|
EXPOSE 9000
|
||||||
|
|
||||||
ENTRYPOINT [ "entrypoint.sh" ]
|
ENTRYPOINT [ "entrypoint.sh" ]
|
Loading…
Add table
Reference in a new issue