Pin Alpine 3.23, single base for builder + runtime, add smoke test
- Both stages on alpine:3.23 (was python:3-alpine + alpine:latest). Major.minor pin gives security patches without breaking on rebase. - fangfrisch installed in /opt/fangfrisch venv (PEP 668 blocks system pip on modern Alpine). - Drop deprecated MAINTAINER instruction in favour of LABEL. - test_smoke.sh: image present + version + sig count + EICAR. Validated end-to-end on amd64 Linux: ClamAV 1.4.4, 3.85M sigs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+12
-10
@@ -1,20 +1,22 @@
|
||||
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
|
||||
FROM alpine:3.23 AS builder
|
||||
LABEL maintainer="tabledevil"
|
||||
RUN apk add --no-cache clamav clamav-libunrar freshclam python3 py3-pip bash
|
||||
# fangfrisch needs Python; PEP 668 on modern Alpine blocks system-pip, use venv.
|
||||
RUN python3 -m venv /opt/fangfrisch && /opt/fangfrisch/bin/pip install fangfrisch
|
||||
RUN mkdir -m 0770 -p /var/lib/fangfrisch && 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 /opt/fangfrisch/bin/fangfrisch --conf /etc/fangfrisch.conf initdb
|
||||
RUN /opt/fangfrisch/bin/fangfrisch --conf /etc/fangfrisch.conf refresh
|
||||
RUN freshclam
|
||||
|
||||
|
||||
FROM alpine
|
||||
FROM alpine:3.23
|
||||
ARG PUID=1001
|
||||
ARG PGID=1001
|
||||
MAINTAINER tabledevil
|
||||
RUN apk add -u --no-cache clamav clamav-daemon clamav-clamdscan bash clamav-libunrar
|
||||
LABEL maintainer="tabledevil"
|
||||
LABEL docker.cmd="docker run -it --rm -v /folder/to/scan:/data:ro --network=none tabledevil/clamav scan"
|
||||
RUN apk add --no-cache clamav clamav-daemon clamav-clamdscan bash clamav-libunrar
|
||||
COPY --from=builder /var/lib/clamav /var/lib/clamav
|
||||
ADD clamd.conf /etc/clamav/clamd.conf
|
||||
ADD start.sh /start.sh
|
||||
|
||||
Reference in New Issue
Block a user