2024-02-16 23:21:18 +08:00
|
|
|
# syntax=docker/dockerfile:latest
|
2024-07-09 21:01:27 +08:00
|
|
|
# Probably from this file: https://github.com/Cisco-Talos/clamav-docker/blob/main/clamav/1.3/alpine/Dockerfile
|
2024-09-16 20:43:39 +08:00
|
|
|
FROM clamav/clamav:1.4.1-5
|
2022-03-16 06:46:58 +08:00
|
|
|
|
2024-07-09 21:01:27 +08:00
|
|
|
COPY clamav.conf /clamav.conf
|
2024-07-11 23:07:14 +08:00
|
|
|
COPY --chmod=775 start.script /start.script
|
2023-05-03 22:27:52 +08:00
|
|
|
|
2023-05-03 23:02:43 +08:00
|
|
|
RUN set -ex; \
|
2024-04-17 23:52:42 +08:00
|
|
|
apk upgrade --no-cache -a; \
|
2024-07-09 21:01:27 +08:00
|
|
|
apk add --no-cache tzdata bash; \
|
2023-06-07 20:50:35 +08:00
|
|
|
mkdir -p /var/run/clamav /run/lock; \
|
|
|
|
chown -R clamav:clamav /var/run/clamav /run/clamav /var/log/clamav /var/lock /run/lock; \
|
2024-07-11 21:54:25 +08:00
|
|
|
chmod 777 -R /var/run/clamav /run/clamav /var/log/clamav /var/lock /run/lock /tmp; \
|
2024-07-11 23:07:14 +08:00
|
|
|
sed -i "/^set -eu/r /start.script" /init-unprivileged; \
|
2024-07-11 23:24:59 +08:00
|
|
|
rm /start.script; \
|
|
|
|
grep -q 'clamd --foreground &' /init-unprivileged; \
|
2024-07-11 23:28:25 +08:00
|
|
|
sed -i "s|clamd --foreground \&|clamd --foreground --config-file /tmp/clamd.conf \&|" /init-unprivileged; \
|
2024-07-11 23:24:59 +08:00
|
|
|
cat /init-unprivileged
|
2023-06-03 20:56:05 +08:00
|
|
|
|
2023-06-07 20:50:35 +08:00
|
|
|
VOLUME /var/lib/clamav
|
|
|
|
|
|
|
|
USER clamav
|
2023-06-03 20:56:05 +08:00
|
|
|
|
2023-06-26 06:56:08 +08:00
|
|
|
LABEL com.centurylinklabs.watchtower.enable="false"
|
2024-07-09 21:01:27 +08:00
|
|
|
|
2024-07-11 23:24:59 +08:00
|
|
|
ENTRYPOINT ["/init-unprivileged"]
|