model-scan-3 / Dockerfile
pengdaqian
change
452d527
raw
history blame
1.33 kB
FROM clamav/clamav:stable
RUN apk update && apk add --no-cache \
python3 \
py3-pip \
&& rm -rf /var/cache/apk/*
RUN mkdir -p /run/clamav
RUN chmod -R 777 /run/clamav
RUN mkdir -p /var/lib/clamav
RUN chmod -R 777 /var/lib/clamav
RUN mkdir -p /var/log/clamav
RUN chmod -R 777 /var/log/clamav
RUN adduser --disabled-password --uid 1000 user
RUN sed -i 's/User clamav/User user/g' /etc/clamav/clamav-milter.conf
RUN cat /etc/clamav/clamav-milter.conf
RUN sed -i 's/User clamav/User user/g' /etc/clamav/clamd.conf
RUN cat /etc/clamav/clamd.conf
RUN chown user:user /var/lib/clamav/bytecode.cvd
RUN chown user:user /var/lib/clamav/daily.cvd
RUN chown user:user /var/lib/clamav/daily.cvd
RUN chown user:user /var/lib/clamav/main.cvd
RUN chown user:user /var/lib/clamav
RUN ls -lha /var/lib/clamav
USER user
RUN clamd restart
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
RUN chown user:user /var/lib/clamav/bytecode.cvd
RUN chown user:user /var/lib/clamav/daily.cvd
RUN chown user:user /var/lib/clamav/daily.cvd
RUN chown user:user /var/lib/clamav/main.cvd
RUN chown user:user /var/lib/clamav
WORKDIR $HOME/app
COPY requirements.txt requirements.txt
RUN pip3 install --no-cache-dir -r requirements.txt
COPY --chown=user init /init
RUN chmod +x /init
COPY . .
CMD ["sh", "-c", "python3 scan_main.py"]