1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-08-10 22:31:28 +02:00

add dsvpn

This commit is contained in:
kev
2019-12-12 20:19:46 +08:00
parent de973aa032
commit 531096b358
9 changed files with 198 additions and 0 deletions

27
dsvpn/Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
FROM alpine AS builder
ENV DSVPN_VERSION=0.1.4
ENV DSVPN_URL=https://github.com/jedisct1/dsvpn/archive/${DSVPN_VERSION}.tar.gz
RUN set -xe \
&& apk add --no-cache build-base curl linux-headers \
&& curl -sSL ${DSVPN_URL} | tar xz \
&& cd dsvpn-${DSVPN_VERSION} \
&& make PREFIX=/usr install
#
# Dockerfile for dsvpn
#
FROM alpine
MAINTAINER EasyPi Software Foundation
RUN apk add --no-cache iptables
COPY --from=builder /usr/sbin/dsvpn /usr/sbin/
WORKDIR /etc/dsvpn
EXPOSE 443
ENTRYPOINT ["dsvpn"]
CMD ["server", "vpn.key"]

43
dsvpn/README.md Normal file
View File

@@ -0,0 +1,43 @@
dsvpn
=====
[DSVPN][1] is a Dead Simple VPN
docker-compose.yml
------------------
```yaml
dsvpn:
image: vimagick/dsvpn
command: server vpn.key auto 1959
ports:
- "1959:1959"
volumes:
- ./data:/etc/dsvpn
working_dir: /etc/dsvpn
devices:
- /dev/net/tun
privileged: true
restart: unless-stopped
```
server
------
```bash
$ mkdir -p data
$ dd if=/dev/urandom of=data/vpn.key count=1 bs=32
$ docker-compose up -d
$ docker-compose logs -f
```
client
------
```bash
$ sudo dsvpn vpn.key 1.2.3.4 1959
$ ifconfig tun0
$ ping 192.168.192.254
```
[1]: https://github.com/jedisct1/dsvpn

11
dsvpn/docker-compose.yml Normal file
View File

@@ -0,0 +1,11 @@
dsvpn:
image: vimagick/dsvpn
command: server vpn.key auto 1959
ports:
- "1959:1959"
volumes:
- ./data:/etc/dsvpn
devices:
- /dev/net/tun
privileged: true
restart: unless-stopped