diff options
author | Ali Yousuf <aly.yousuf7@gmail.com> | 2017-03-22 13:06:13 +0500 |
---|---|---|
committer | Ali Yousuf <aly.yousuf7@gmail.com> | 2017-03-22 13:06:13 +0500 |
commit | 5766a70297e7da19022894176221cdf0a636be42 (patch) | |
tree | 3994769af607e7444e88c709ef03ae5cbc6c8f53 | |
parent | b8eeb4a403ce6bcf2fd821d0b22b5739424b971c (diff) | |
download | sshtron-5766a70297e7da19022894176221cdf0a636be42.tar.gz |
Add Dockerfile
-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) |