From efca35b0e97bf3633262ab58bdfedad127188c3a Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Thu, 11 Jul 2024 17:07:14 +0200 Subject: [PATCH] try to fix it Signed-off-by: Simon L. --- Containers/clamav/Dockerfile | 8 ++++---- Containers/clamav/{start.sh => start.script} | 7 ------- 2 files changed, 4 insertions(+), 11 deletions(-) rename Containers/clamav/{start.sh => start.script} (65%) diff --git a/Containers/clamav/Dockerfile b/Containers/clamav/Dockerfile index 46c0b600..721aea2b 100644 --- a/Containers/clamav/Dockerfile +++ b/Containers/clamav/Dockerfile @@ -3,7 +3,7 @@ FROM clamav/clamav:1.3.1-59 COPY clamav.conf /clamav.conf -COPY --chmod=775 start.sh /start.sh +COPY --chmod=775 start.script /start.script RUN set -ex; \ apk upgrade --no-cache -a; \ @@ -11,8 +11,8 @@ RUN set -ex; \ 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; \ - grep -q '#!/sbin/tini /bin/sh' /init; \ - sed -i 's|#!/sbin/tini /bin/sh|#!/bin/sh|' /init + sed -i "/^set -eu/r /start.script" /init-unprivileged; \ + rm /start.script VOLUME /var/lib/clamav @@ -20,4 +20,4 @@ USER clamav LABEL com.centurylinklabs.watchtower.enable="false" -ENTRYPOINT ["/start.sh"] +ENTRYPOINT ["/init-unprivileged", "--config-file", "/tmp/clamd.conf"] diff --git a/Containers/clamav/start.sh b/Containers/clamav/start.script similarity index 65% rename from Containers/clamav/start.sh rename to Containers/clamav/start.script index 0f19f86b..c9a530ab 100644 --- a/Containers/clamav/start.sh +++ b/Containers/clamav/start.script @@ -1,11 +1,4 @@ -#!/bin/bash - # Adjust settings cat /etc/clamav/clamd.conf > /tmp/clamd.conf CLAMAV_FILE="$(sed "s|10G|$MAX_SIZE|" /clamav.conf)" echo "$CLAMAV_FILE" >> /tmp/clamd.conf - -# Call initial init -/init --config-file="/tmp/clamd.conf" - -exec "$@"