diff options
author | Zach Latta <zach@zachlatta.com> | 2017-03-22 11:05:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-22 11:05:01 -0700 |
commit | 6487cebad6447798eaa7b70d56af8bd630df772e (patch) | |
tree | d669d1be488244c2407939288bb01d63760510ef | |
parent | b8eeb4a403ce6bcf2fd821d0b22b5739424b971c (diff) | |
parent | 616c73a2941eb1a7a11e0e79fa7c5f0a1e269166 (diff) | |
download | sshtron-6487cebad6447798eaa7b70d56af8bd630df772e.tar.gz |
Merge pull request #20 from ali-yousuf-10p/master
Add Dockerfile
-rw-r--r-- | .dockerignore | 2 | ||||
-rw-r--r-- | Dockerfile | 15 | ||||
-rw-r--r-- | README.md | 14 |
3 files changed, 31 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,20 @@ $ 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 +``` + +For RaspberryPi, change the Base Image in `Dockerfile` from `golang:latest` to `apicht/rpi-golang:latest`. + ## 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) |