1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-28 09:08:36 +02:00
This commit is contained in:
kev 2016-06-30 14:19:43 +08:00
parent de93e5a397
commit ba027d41a3
6 changed files with 96 additions and 0 deletions

View File

@ -97,6 +97,7 @@ A collection of delicious docker recipes.
- [x] plex :moneybag:
- [x] polipo
- [x] portia
- [x] pptp
- [x] pptpd
- [x] privoxy
- [x] privoxy-arm

View File

@ -6,3 +6,4 @@ openconnect:
- ./data:/etc/openconnect
stop_signal: SIGINT
privileged: yes
restart: unless-stopped

15
pptp/Dockerfile Normal file
View File

@ -0,0 +1,15 @@
#
# Dockerfile for pptp
#
FROM debian
MAINTAINER kev <noreply@easypi.info>
RUN set -xe \
&& apt-get update \
&& apt-get install -y iptables pptp-linux \
&& rm -rf /var/lib/apt/lists/*
COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

41
pptp/README.md Normal file
View File

@ -0,0 +1,41 @@
pptp
====
Containerized PPTP Client
## docker-compose.yml
```yaml
pptp:
image: vimagick/pptp
environment:
- SERVER=1.2.3.4
- TUNNEL=vps
- USERNAME=username
- PASSWORD=password
net: host
privileged: yes
restart: unless-stopped
```
## up and running
```
sudo modprobe nf_conntrack_pptp nf_conntrack_proto_gre
docker-compose up -d
docker-compose logs -f
ip link show
ip addr show
ip route show
curl ifconfig.co
curl ifconfig.ovh
curl ifconfig.me
```
## references
- <http://pptpclient.sourceforge.net/howto-debian.phtml>
- <https://wiki.archlinux.org/index.php/PPTP_Client>

10
pptp/docker-compose.yml Normal file
View File

@ -0,0 +1,10 @@
pptp:
image: vimagick/pptp
environment:
- SERVER=192.168.31.222
- TUNNEL=vps
- USERNAME=username
- PASSWORD=password
net: host
privileged: yes
restart: unless-stopped

28
pptp/docker-entrypoint.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
cat > /etc/ppp/peers/${TUNNEL} <<_EOF_
pty "pptp ${SERVER} --nolaunchpppd"
name "${USERNAME}"
password "${PASSWORD}"
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam "${TUNNEL}"
_EOF_
cat > /etc/ppp/ip-up.d/9999routes <<_EOF_
#!/bin/bash
ip route add 0.0.0.0/1 dev \$1
ip route add 128.0.0.0/1 dev \$1
_EOF_
cat > /etc/ppp/ip-down.d/9999routes <<_EOF_
#!/bin/bash
ip route del 0.0.0.0/1 dev \$1
ip route del 128.0.0.0/1 dev \$1
_EOF_
chmod +x /etc/ppp/ip-up.d/9999routes
chmod +x /etc/ppp/ip-down.d/9999routes
exec pon ${TUNNEL} debug dump logfd 2 nodetach persist "$@"