Skip to content

Commit 46024ec

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents a31cc18 + 96806c6 commit 46024ec

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM php:8.2-cli
2+
3+
# Install dependencies
4+
RUN apt-get update && apt-get install -y \
5+
git \
6+
unzip \
7+
libzip-dev \
8+
&& docker-php-ext-install zip
9+
10+
WORKDIR /scanner
11+
COPY . .
12+
RUN chmod +x scan
13+
14+
ENTRYPOINT ["./scan"]
15+
CMD ["/code"]

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,37 @@ Licensing
146146
---------
147147

148148
PHP malware scanner is [licensed](https://github.com/scr34m/php-malware-scanner/blob/master/LICENSE.txt) under the GNU General Public License v3.
149+
150+
Docker Usage
151+
-----------
152+
153+
You can also run the scanner using Docker:
154+
155+
1. Build the image:
156+
```bash
157+
docker build -t php-malware-scanner .
158+
```
159+
160+
2. Scan a directory:
161+
```bash
162+
docker run -v /path/to/scan:/code php-malware-scanner -d /code
163+
```
164+
165+
For example, to scan a WordPress installation:
166+
```bash
167+
docker run -v /var/www/html:/code php-malware-scanner -d /code -j 6.4.1
168+
```
169+
170+
Common usage with flags:
171+
```bash
172+
# Show only infected files (hide OK status)
173+
docker run -v /path/to/scan:/code php-malware-scanner -d /code -k
174+
175+
# Show comments for matched patterns
176+
docker run -v /path/to/scan:/code php-malware-scanner -d /code -c
177+
178+
# Show MD5 hashes and continue after first match
179+
docker run -v /path/to/scan:/code php-malware-scanner -d /code -m -s
180+
```
181+
182+
The `/code` directory inside the container is where your files will be mounted for scanning.

0 commit comments

Comments
 (0)