This is a Docker Image for a lightweight containerized ClamAV Mirror using CVD-Update and Caddy. This image uses Alpine to minimize the image size and unnecessary bloat.
- Docker
Run the following commands to build and run the clamav-mirror Docker image locally.
docker build . --file Dockerfile --tag clamav-mirror:latest
docker run -it --rm --name clamav-mirror -p 8080:8080 clamav-mirror
# Create a detached volume
docker volume create cvdupdate
# Run the mirror with the volume mounted
docker run -it --rm --name clamav-mirror -p 8080:8080 \
--mount source=cvdupdate,target=/mnt/cvdupdate clamav-mirror
# Delete the detached volume
docker volume rm cvdupdate
docker exec -it clamav-mirror ./entrypoint.sh update
Once you have the mirror running, you can visit http://localhost:8080 to see what files are hosted by this server. You can then point any of your ClamAV instances to use this mirror instead by changing the following in your freshclam.conf
file:
DatabaseMirror http://localhost:8080
some helpful commands for developing and troubleshooting:
# build image
# run container and get into bash
docker run --name clamav --rm -it clamav-mirror bash
# run status
sh entrypoint.sh status
# check config file and paths
cat /mnt/cvdupdate/config.json
ls -laht /mnt/cvdupdate/{logs,databases}
# run update and check files
sh entrypoint.sh update
ls -laht /mnt/cvdupdate/databases/*.cvd