Merge pull request #205 from inztar/master

add Dockerfile
This commit is contained in:
Yves Rutschle 2021-07-31 16:28:42 +02:00 committed by GitHub
commit 82b8ba547e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -103,6 +103,15 @@ release:
git archive master --prefix="sslh-$(VERSION)/" | gzip > /tmp/sslh-$(VERSION).tar.gz
gpg --detach-sign --armor /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

@ -37,6 +37,54 @@ Please refer to the [configuration guide](doc/config.md).
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?
====================