Skip to content

Latest commit

 

History

History
73 lines (48 loc) · 1.72 KB

README.md

File metadata and controls

73 lines (48 loc) · 1.72 KB

ClamAV-Mirror

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.

Dependencies

  • Docker

Quick Start Guide

Run the following commands to build and run the clamav-mirror Docker image locally.

Build

docker build . --file Dockerfile --tag clamav-mirror:latest

Run (Ephemeral)

docker run -it --rm --name clamav-mirror -p 8080:8080 clamav-mirror

Run (Persistent)

# 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

Update ClamAV Database definitions

docker exec -it clamav-mirror ./entrypoint.sh update

ClamAV Configuration

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

Run (dev & troubleshooting)

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