From 7606e3f5bcc045e68f0b48e4ab0b8f1a28f3f577 Mon Sep 17 00:00:00 2001 From: hupe1980 Date: Wed, 29 Dec 2021 15:53:32 +0100 Subject: [PATCH] Add docker support --- Dockerfile | 8 ++++++++ Makefile | 5 +++++ README.md | 10 ++++++++++ 3 files changed, 23 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8681a2b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM golang:1.17-bullseye +WORKDIR /app +COPY go.mod ./ +COPY go.sum ./ +RUN go mod download +COPY . ./ +RUN GOOS=linux go build -o /scan4log4shell +ENTRYPOINT ["/scan4log4shell"] \ No newline at end of file diff --git a/Makefile b/Makefile index 7e8a65d..952a5eb 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,11 @@ test: build: @go build -o scan4log4shell . +.PHOMY: docker-build +## docker-build: Build a docker image +docker-build: + docker build -t scan4log4shell . + .PHONY: run run: @go run *.go remote url -h diff --git a/README.md b/README.md index 3ea3253..f261c5f 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,16 @@ make build (Add the appropriate .exe extension on Windows systems, of course.) +## Docker Support +```bash +git clone https://github.com/hupe1980/scan4log4shell +cd scan4log4shell +make docker-build + +# Scan the current working directory +docker run -it --rm -v $PWD:/data scan4log4shell local /data +``` + ## Usage ```console Usage: