diff options
-rw-r--r-- | .dockerignore | 2 | ||||
-rw-r--r-- | Dockerfile | 15 | ||||
-rw-r--r-- | README.md | 12 |
3 files changed, 29 insertions, 0 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..afb3206 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +# Ignore the already generated RSA key-pair +id_rsa* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..93bbe2c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM golang:latest + +ENV PROJECT_NAME sshtron +ENV PROJECT_PATH github.com/zachlatta/sshtron + +ADD . $GOPATH/src/$PROJECT_PATH +WORKDIR $GOPATH/src/$PROJECT_PATH + +RUN apt-get update && apt-get install openssh-client && \ + ssh-keygen -t rsa -N "" -f id_rsa && \ + go get && go install && \ + rm -rf /var/lib/apt/lists/* + +ENTRYPOINT sshtron + @@ -31,6 +31,18 @@ $ go get && go build $ ./sshtron ``` +## Running under a Docker container + +Clone the project and `cd` into its directory. + +```sh +# Build the sshtron Docker image +$ docker build -t sshtron . + +# Spin up the container with always-restart policy +$ docker run -t -d -p 2022:2022 --restart always --name sshtron sshtron +``` + ## CVE-2016-0777 [CVE-2016-0777](https://www.qualys.com/2016/01/14/cve-2016-0777-cve-2016-0778/openssh-cve-2016-0777-cve-2016-0778.txt) |