Dockerize honeypot using multi-stage Dockerfile (#1)
* Add Dockerfile * Add instructions for running as docker container
This commit is contained in:
parent
fb81cffa7e
commit
a06f2538c3
|
@ -0,0 +1,6 @@
|
|||
payloads/
|
||||
.idea/
|
||||
.dockerignore
|
||||
.gitignore
|
||||
Dockerfile
|
||||
README.md
|
|
@ -0,0 +1,16 @@
|
|||
# Build environment
|
||||
FROM golang:1.17-alpine AS builder
|
||||
|
||||
COPY . $GOPATH/src/github.com/Adikso/minecraft-log4j-honeypot
|
||||
WORKDIR $GOPATH/src/github.com/Adikso/minecraft-log4j-honeypot
|
||||
RUN go install .
|
||||
|
||||
# Export binary only from builder environment
|
||||
FROM alpine:latest AS runner
|
||||
|
||||
COPY --from=builder /go/bin/minecraft-log4j-honeypot /usr/local/bin/minecraft-log4j-honeypot
|
||||
|
||||
VOLUME payloads
|
||||
EXPOSE 25565
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/minecraft-log4j-honeypot"]
|
11
README.md
11
README.md
|
@ -7,10 +7,19 @@ This honeypots runs fake Minecraft server (1.7.2 - 1.16.5 without snapshots) wai
|
|||
|
||||
## Running
|
||||
|
||||
|
||||
### Natively
|
||||
```
|
||||
git clone https://github.com/Adikso/minecraft-log4j-honeypot.git
|
||||
cd minecraft-log4j-honeypot
|
||||
go build .
|
||||
./minecraft-log4j-honeypot
|
||||
```
|
||||
|
||||
### Using docker
|
||||
```
|
||||
git clone https://github.com/Adikso/minecraft-log4j-honeypot.git
|
||||
cd minecraft-log4j-honeypot
|
||||
docker build -t minecraft-log4j-honeypot .
|
||||
mkdir payloads
|
||||
docker run --rm -it --mount type=bind,source="${PWD}/payloads",target=/payloads --user=`id -u` -p 25565:25565 minecraft-log4j-honeypot
|
||||
```
|
Loading…
Reference in New Issue