add Dockerfile

This commit is contained in:
Taras Inzyk 2019-04-06 13:40:23 +05:00
parent e528f519bc
commit 95a6577cda
3 changed files with 80 additions and 0 deletions

23
Dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM alpine:latest as build
ADD . /sslh
RUN \
apk add \
gcc \
libconfig-dev \
make \
musl-dev \
pcre-dev \
perl && \
cd /sslh && \
make sslh-select && \
strip sslh-select
FROM alpine:latest
COPY --from=build /sslh/sslh-select /sslh
RUN apk --no-cache add libconfig pcre
ENTRYPOINT [ "/sslh", "--foreground"]

View File

@ -97,6 +97,15 @@ $(MAN): sslh.pod Makefile
release:
git archive master --prefix="sslh-$(VERSION)/" | gzip > /tmp/sslh-$(VERSION).tar.gz
# Build docker image
docker:
docker image build -t "sslh:${VERSION}" .
docker image tag "sslh:${VERSION}" sslh:latest
docker-clean:
yes | docker image rm "sslh:${VERSION}" sslh:latest
yes | docker image prune
# generic install: install binary and man page
install: sslh $(MAN)
mkdir -p $(DESTDIR)/$(BINDIR)

View File

@ -450,6 +450,54 @@ many connections to ssh from the same IP address...)
See example files in scripts/fail2ban.
Docker image
------------
How to use
---
Build docker image
make docker
```bash
docker container run \
--rm \
-it \
--listen=0.0.0.0:443 \
--ssh=hostname:22 \
--tlshostname:443 \
sslh:latest
```
docker-compose example
```
---
version: "3"
services:
sslh:
image: sslh:latest
hostname: sslh
ports:
- 443:443/tcp
command: --listen=0.0.0.0:443 --tlshostname:443 --openvpn=openvpn:1194
depends_on:
- nginx
- openvpn
nginx:
image: nginx
hostname: nginx
openvpn:
image: openvpn:latest
hostname: openvpn
```
Comments? Questions?
====================