diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c5aeed3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +payloads/ +.idea/ +.dockerignore +.gitignore +Dockerfile +README.md \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a85c6f0 --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index 4334219..5ce86a0 100644 --- a/README.md +++ b/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 +``` \ No newline at end of file