Added support for building official docker images. (#76)

This commit is contained in:
Joe Testa 2020-10-20 11:31:50 -04:00
parent 83d8014a50
commit 17780ff194
5 changed files with 44 additions and 0 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
src/ssh_audit/__pycache__/
src/ssh_audit.egg-info/
src/ssh_audit/*~

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM python:3.8-slim
WORKDIR /
COPY ssh-audit.py .
COPY src/ .
ENTRYPOINT ["python3", "/ssh-audit.py"]
EXPOSE 2222

13
Makefile.docker Normal file
View File

@ -0,0 +1,13 @@
VERSION = $(shell grep VERSION src/ssh_audit/globals.py | grep -E -o "'(v.*)'" | tr -d "'")
ifeq ($(VERSION),)
$(error "could not determine version!")
endif
all:
docker build -t positronsecurity/ssh-audit:${VERSION} .
docker tag positronsecurity/ssh-audit:${VERSION} positronsecurity/ssh-audit:latest
upload:
docker login
docker push positronsecurity/ssh-audit:${VERSION}
docker push positronsecurity/ssh-audit:latest

View File

@ -45,3 +45,15 @@ As root, run:
Leave all options default. Bump the version number in snapcraft.yaml. Then run:
# make -f Makefile.snap
----
= Docker =
Build image with:
$ make -f Makefile.docker
Then upload them to Dockerhub with:
$ make -f Makefile.docker upload

View File

@ -147,6 +147,12 @@ To install on Homebrew:
$ brew install ssh-audit
```
To install from Dockerhub:
```
$ docker pull positronsecurity/ssh-audit
```
(Then run with: `docker run -it -p 2222:2222 positronsecurity/ssh-audit 10.1.1.1`)
### Web Front-End
For convenience, a web front-end on top of the command-line tool is available at [https://www.ssh-audit.com/](https://www.ssh-audit.com/).