1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:15 +02:00
This commit is contained in:
kev 2015-06-14 11:06:12 +08:00
parent d834f4e559
commit 1eab8a8d51
3 changed files with 83 additions and 0 deletions

30
tinc/Dockerfile Normal file
View File

@ -0,0 +1,30 @@
#
# Dockerfile for tinc
#
FROM debian:jessie
MAINTAINER kev <noreply@datageek.inf>
ENV NETNAME netname
RUN apt-get update \
&& apt-get install -y net-tools tinc \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /etc/tinc/$NETNAME/hosts
WORKDIR /etc/tinc/$NETNAME
RUN /bin/echo -e 'Name=server\nAddressFamily=ipv4\nInterface=tun0' > tinc.conf \
&& /bin/echo -e 'Subnet=10.0.0.1\nSubnet=0.0.0.0/0' > hosts/server \
&& /bin/echo -e '\n' | tincd -n $NETNAME -K4096 \
&& /bin/echo -e 'ifconfig $INTERFACE 10.0.0.1 netmask 255.255.255.0' > tinc-up \
&& /bin/echo -e 'ifconfig $INTERFACE down' > tinc-down \
&& chmod +x tinc-up tinc-down
VOLUME /etc/tinc
EXPOSE 655/udp
CMD tincd --no-detach \
--debug 3 \
--net $NETNAME \
--pidfile /run/tinc.$NETNAME.pid

44
tinc/README.md Normal file
View File

@ -0,0 +1,44 @@
[`tinc`][1] is a Virtual Private Network (VPN) daemon that uses tunnelling and
encryption to create a secure private network between hosts on the Internet.
To use this image, you need to:
- Have baisc knowledges of tinc
- Create a directory tree by hand [read this][2]
- Use `docker-compose` to manage
## directory tree
```
~/fig/tinc/
├── docker-compose.yml
└── tinc/
├── netname/
│   ├── hosts/
│   │   ├── client
│   │   ├── client-down
│   │   ├── client-up
│   │   └── server
│   ├── rsa_key.priv
│   ├── tinc.conf
│   ├── tinc-down
│   └── tinc-up
└── nets.boot
```
## docker-compose.yml
```
server:
image: vimagick/tinc
ports:
- "655:655/udp"
volumes:
- tinc:/etc/tinc
net: host
privileged: true
restart: always
```
[1]: http://tinc-vpn.org/
[2]: https://www.digitalocean.com/community/tutorials/how-to-install-tinc-and-set-up-a-basic-vpn-on-ubuntu-14-04

9
tinc/docker-compose.yml Normal file
View File

@ -0,0 +1,9 @@
server:
image: vimagick/tinc
ports:
- "655:655/udp"
volumes:
- tinc:/etc/tinc
net: host
privileged: true
restart: always