-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile
44 lines (36 loc) · 1.13 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM malice/alpine
LABEL maintainer "https://github.com/blacktop"
LABEL malice.plugin.repository = "https://github.com/malice-plugins/clamav.git"
LABEL malice.plugin.category="av"
LABEL malice.plugin.mime="*"
LABEL malice.plugin.docker.engine="*"
COPY . /go/src/github.com/malice-plugins/clamav
RUN apk --update add --no-cache clamav ca-certificates
RUN apk --update add --no-cache -t .build-deps \
build-base \
mercurial \
musl-dev \
openssl \
bash \
wget \
git \
gcc \
go \
&& echo "Building avscan Go binary..." \
&& cd /go/src/github.com/malice-plugins/clamav \
&& export GOPATH=/go \
&& go version \
&& go get \
&& go build -ldflags "-s -w -X main.Version=v$(cat VERSION) -X main.BuildTime=$(date -u +%Y%m%d)" -o /bin/avscan \
&& rm -rf /go /usr/local/go /usr/lib/go /tmp/* \
&& apk del --purge .build-deps
# Update ClamAV Definitions
RUN mkdir -p /opt/malice \
&& chown malice /opt/malice \
&& freshclam
# Add EICAR Test Virus File to malware folder
ADD http://www.eicar.org/download/eicar.com.txt /malware/EICAR
RUN chown malice -R /malware
WORKDIR /malware
ENTRYPOINT ["/bin/avscan"]
CMD ["--help"]