This example runs ClamAV in a container using the official Docker image.
See Docker installation: Docker
The official ClamAV Docker images are published by Cisco Talos:
clamav/clamav:latest (Alpine-based with full ClamAV features)clamav/clamav:latest_base (Minimal Alpine-based image)# Pull the official ClamAV image
docker pull clamav/clamav:latest
# Run ClamAV scan on a local directory
docker run --rm -v /path/to/scan:/tmp/scan:ro clamav/clamav:latest clamscan -r /tmp/scan
# Run ClamAV daemon (clamd) for continuous scanning
docker run -d --name clamav -v /path/to/database:/var/lib/clamav clamav/clamav:latest
version: '3.8'
services:
clamav:
image: clamav/clamav:latest
container_name: clamav
volumes:
- clamav-db:/var/lib/clamav
- /path/to/scan:/tmp/scan:ro
restart: unless-stopped
volumes:
clamav-db: