I just watched Story of Yanxi Palace recently, so I wanted to introduce a MacOS anti-drug strategy.
This article teaches you how to use Docker to clean MacOS.
Briefly introduce how we use OpenSource anti-virus software to scan through docker.
It is assumed that my current directory is in my home directory, so ${PWD} represents the directory, so my home directory will be mounted to the scan folder in the container.
When I use clamscan -r /scan/ -l clamav.log, I can scan all files in my home directory on MacOS,
Adding the -r parameter will use the recursive method to enter the subdirectory layer by layer to scan,
Adding -l can generate a log of the scanned file, which is displayed directly on the standard output (stdout) by default.
The following is the complete process:
#Execute the Ubuntu container and enter the container
docker run --rm -v ${PWD}:/scan -ti ubuntu bash
#Update ubuntu system
apt-get update
# Install antivirus software
apt-get install clamav
#Update virus pattern
fresh clam
# scan
root@6374ee5a469f:/scan# clamscan -l /scan/clamav.log -r /scan/
....slightly......
/scan/cut version HTML.zip: OK
/scan/Lecture system optimization.docx: OK
/scan/Refund_Refund rules for each district_ok.xlsx: OK
-----------SCAN SUMMARY-----------
Known viruses: 6641063
Engine version: 0.100.1
Scanned directories: 1
Scanned files: 122
Infected files: 0
Data scanned: 79.29 MB
Data read: 742.52 MB (ratio 0.11:1)
Time: 17.035 sec (0 m 17 s)
root@7590c5c17f32:/#
Above is the simulated screen. As an aside, smart you, have you noticed that because it is a Docker environment, you need to slightly adjust the configuration file of docker-compose.
We can easily mount the site folder, so that we can access the project on D-Laravel Let's clean it up.
Of course, we have to build a clamav image file ourselves.
No Comment
Post your comment