clamav
ClamAV Overview
Secure your stack with a hardened ClamAV image freshly-built by Minimus. Minimus images always include the most up-to-date package version for all packages and dependencies contained in the image.
ClamAV is an antivirus engine for detecting malware in files and email. Use this image to run the clamd and freshclam daemons in a container.
Try It Out
This example starts ClamAV with a persistent signature database volume, then scans a test file. ClamAV needs substantial memory to load virus definitions so you'll want to allocate at least 3 GiB, preferably 4 GiB, for the container (memory requirements).
Step 1: Create a Database Volume
Create a Docker volume to persist ClamAV signature databases under /var/lib/clamav.
docker volume create clam_dbA Docker-managed named volume seamlessly persists data across container replacements without requiring a host directory, thereby avoiding file ownership and permission conflicts common with bind mounts.
Step 2: Start ClamAV
Start the container in the background, mount the volume, and publish the clamd TCP port:
docker run -d --name minimus-clamav \
-p 3310:3310 \
--mount source=clam_db,target=/var/lib/clamav \
reg.mini.dev/clamavThe first start can take several minutes while freshclam downloads signature databases into the volume. Watch the logs until clamd is ready:
docker logs -f minimus-clamavStep 3: Scan a Test File
Create the standard EICAR test file on your host (a harmless file that antivirus products detect by design):
echo 'X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*' > eicar.comCopy it into the container and run clamscan:
docker cp eicar.com minimus-clamav:/tmp/eicar.com
docker exec minimus-clamav clamscan /tmp/eicar.comYou should see output indicating the file was found, for example:
/tmp/eicar.com: Eicar-Signature FOUND
----------- SCAN SUMMARY -----------
Known viruses: 3627863
Engine version: 1.5.2
Scanned directories: 0
Scanned files: 1
Infected files: 1
...Clean Up
Remove the container. The clam_db volume is kept unless you delete it separately:
docker rm -f minimus-clamav
rm -f eicar.comTo remove the signature volume as well:
docker volume rm clam_dbTechnical Considerations
The ClamAV image provided by Minimus is a slim, security-hardened alternative to the public image from Docker Hub. The images are largely interchangeable, with a few differences as noted below.
ClamAV built by Minimus:
- Runs as root to support required functions.
- Signature databases live under
/var/lib/clamav. Mount a Docker volume to persist definitions across container restarts, as described above. clamdlistens on TCP port3310by default. Publish that port when other hosts or containers need to connect.- Drill down on the version specification tab to see the default user, listening ports, entrypoint, volumes, environment variables, etc.
The Payoff
A hardened, minimal image that will remain more secure for the long run and accrue vulnerabilities at a slower rate.
- See the risk reduction dashboard for a detailed CVE comparison over the past 30 days.
- Review the compliance report to see the default hardening and security configurations for the image.
Terms & Info
Trademark
This catalog is published by Minimus. All product names, logos, and marks, other than those belonging to Minimus, shown are owned by their respective rights holders and appear here only to identify the open source software each image contains. Minimus claims no ownership of those marks and implies no affiliation with, endorsement by, certification by, or sponsorship by any rights holder.
Disclaimer
Images are provided "as-is" without warranty of any kind. "Hardened" refers to the security configuration applied at the time of build and does not constitute a guarantee of ongoing security or absence of vulnerabilities. The free tier is provided without support, SLA, or guaranteed patching timelines. Security updates may be applied to paid subscriptions before or instead of free tier images. By pulling or using any image you agree to our Terms of Use.