diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..cfed3b9a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:1.13.11-alpine3.10 AS build-env + +RUN apk add --no-cache --upgrade git openssh-client ca-certificates +RUN go get -u github.com/golang/dep/cmd/dep +WORKDIR /go/src/app + +# Install +RUN go get -u github.com/projectdiscovery/nuclei/cmd/nuclei + +ENTRYPOINT ["nuclei"] \ No newline at end of file diff --git a/README.md b/README.md index 6b124d24..df85c522 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ We have also [open-sourced a dedicated repository](https://github.com/projectdis - [Installation Instructions](#installation-instructions) - [From Binary](#from-binary) - [From Source](#from-source) + - [Running in a Docker Container](#running-in-a-docker-container) - [Running nuclei](#running-nuclei) - [1. Running nuclei with a single template.](#1-running-nuclei-with-a-single-template) - [2. Running nuclei with multiple templates.](#2-running-nuclei-with-multiple-templates) @@ -86,6 +87,25 @@ nuclei requires go1.13+ to install successfully. Run the following command to ge In order to update the tool, you can use -u flag with `go get` command. +### Running in a Docker Container + +- Clone the repo using `git clone https://github.com/projectdiscovery/nuclei.git` +- Build your docker container +```bash +> docker build -t projectdiscovery/nuclei . +``` + +- After building the container using either way, run the following: +```bash +> docker run -it projectdiscovery/nuclei +``` + +For example, this will run the tool against all the hosts in `urls.txt` and output the results to your host file system: +```bash +> cat urls.txt | docker run -v /path-to-nuclei-templates:/go/src/app/ -i projectdiscovery/nuclei -t ./files/git-config.yaml > results.txt +``` +Remember to change `/path-to-nuclei-templates` to the real path on your host file system. + # Running nuclei ### 1. Running nuclei with a single template.