mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
Merge pull request #6094 from nextcloud/clamav-alpine-aarch64
clamav: build the container also for aarch64/arm64 by using the alpine package
This commit is contained in:
parent
53abc41cde
commit
9e95d96656
14 changed files with 69 additions and 51 deletions
|
|
@ -1,28 +1,25 @@
|
|||
# syntax=docker/dockerfile:latest
|
||||
# Probably from this file: https://github.com/Cisco-Talos/clamav-docker/blob/main/clamav/1.3/alpine/Dockerfile
|
||||
FROM clamav/clamav:1.4.2-29
|
||||
|
||||
COPY clamav.conf /clamav.conf
|
||||
COPY --chmod=775 start.script /start.script
|
||||
FROM alpine:3.21.3
|
||||
|
||||
RUN set -ex; \
|
||||
apk upgrade --no-cache -a; \
|
||||
apk add --no-cache tzdata bash; \
|
||||
mkdir -p /var/run/clamav /run/lock; \
|
||||
chown -R clamav:clamav /var/run/clamav /run/clamav /var/log/clamav /var/lock /run/lock; \
|
||||
chmod 777 -R /var/run/clamav /run/clamav /var/log/clamav /var/lock /run/lock /tmp; \
|
||||
sed -i "/^set -eu/r /start.script" /init-unprivileged; \
|
||||
rm /start.script; \
|
||||
grep -q 'clamd --foreground &' /init-unprivileged; \
|
||||
sed -i "s|clamd --foreground \&|clamd --foreground --config-file /tmp/clamd.conf \&|" /init-unprivileged; \
|
||||
cat /init-unprivileged
|
||||
apk add --no-cache tzdata clamav supervisord; \
|
||||
mkdir /run/clamav; \
|
||||
chmod 777 -R /run/clamav /var/log/clamav /var/log/supervisord /var/run/supervisord; \
|
||||
sed -i "s|#\?MaxDirectoryRecursion.*|MaxDirectoryRecursion 30|g" /etc/clamav/clamd.conf; \
|
||||
sed -i "s|#\?MaxFileSize.*|MaxFileSize 2G|g" /etc/clamav/clamd.conf; \
|
||||
sed -i "s|#\?PCREMaxFileSize.*|PCREMaxFileSize aio-placeholder|g" /etc/clamav/clamd.conf; \
|
||||
sed -i "s|#\?StreamMaxLength.*|StreamMaxLength aio-placeholder|g" /etc/clamav/clamd.conf; \
|
||||
sed -i "s|#\?TCPSocket|TCPSocket|g" /etc/clamav/clamd.conf; \
|
||||
freshclam --foreground --stdout
|
||||
|
||||
VOLUME /var/lib/clamav
|
||||
COPY --chmod=775 start.sh /start.sh
|
||||
COPY --chmod=775 healthcheck.sh /healthcheck.sh
|
||||
COPY --chmod=664 supervisord.conf /supervisord.conf
|
||||
|
||||
USER 100
|
||||
|
||||
VOLUME /var/lib/clamav
|
||||
ENTRYPOINT ["/start.sh"]
|
||||
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
|
||||
LABEL com.centurylinklabs.watchtower.enable="false"
|
||||
|
||||
HEALTHCHECK --start-period=60s --retries=9 CMD clamdcheck.sh
|
||||
|
||||
ENTRYPOINT ["/init-unprivileged"]
|
||||
HEALTHCHECK --start-period=60s --retries=9 CMD /healthcheck.sh
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
# AIO settings
|
||||
MaxDirectoryRecursion 30
|
||||
MaxFileSize 16G
|
||||
PCREMaxFileSize 16G
|
||||
StreamMaxLength 16G
|
||||
9
Containers/clamav/healthcheck.sh
Normal file
9
Containers/clamav/healthcheck.sh
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
if [ "$(echo "PING" | nc 127.0.0.1 3310)" != "PONG" ]; then
|
||||
echo "ERROR: Unable to contact server"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Clamd is up"
|
||||
exit 0
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
# Adjust settings
|
||||
cat /etc/clamav/clamd.conf > /tmp/clamd.conf
|
||||
CLAMAV_FILE="$(sed "s|16G|$MAX_SIZE|" /clamav.conf)"
|
||||
echo "$CLAMAV_FILE" >> /tmp/clamd.conf
|
||||
5
Containers/clamav/start.sh
Normal file
5
Containers/clamav/start.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
sed "s|aio-placeholder|$MAX_SIZE|" /etc/clamav/clamd.conf > /tmp/clamd.conf
|
||||
|
||||
exec "$@"
|
||||
21
Containers/clamav/supervisord.conf
Normal file
21
Containers/clamav/supervisord.conf
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
[supervisord]
|
||||
nodaemon=true
|
||||
nodaemon=true
|
||||
logfile=/var/log/supervisord/supervisord.log
|
||||
pidfile=/var/run/supervisord/supervisord.pid
|
||||
childlogdir=/var/log/supervisord/
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=10
|
||||
loglevel=error
|
||||
|
||||
[program:freshclam]
|
||||
stdout_logfile=NONE
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=freshclam --foreground --stdout --daemon
|
||||
|
||||
[program:clamd]
|
||||
stdout_logfile=NONE
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=clamd --foreground --config-file=/tmp/clamd.conf
|
||||
|
|
@ -5,7 +5,8 @@ FROM ghcr.io/nextcloud-releases/whiteboard:v1.0.5
|
|||
USER root
|
||||
RUN set -ex; \
|
||||
apk upgrade --no-cache -a; \
|
||||
apk add --no-cache bash
|
||||
apk add --no-cache bash; \
|
||||
chmod 777 -R /tmp
|
||||
USER 65534
|
||||
|
||||
COPY --chmod=775 start.sh /start.sh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue