From 19e34e276d7f542dd0d4c84c63c86eeba2aa47f7 Mon Sep 17 00:00:00 2001 From: kev Date: Sun, 14 Jun 2015 11:48:08 +0800 Subject: [PATCH] update --- tinc/Dockerfile | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tinc/Dockerfile b/tinc/Dockerfile index af28ac2..c464c54 100644 --- a/tinc/Dockerfile +++ b/tinc/Dockerfile @@ -6,6 +6,10 @@ FROM debian:jessie MAINTAINER kev ENV NETNAME netname +ENV PIDFILE /runt/tinc.$NETNAME.pid +ENV VERBOSE 2 +ENV ADDRESS 10.0.0.1 +ENV NETMASK 255.255.255.0 RUN apt-get update \ && apt-get install -y net-tools tinc \ @@ -14,17 +18,18 @@ RUN apt-get update \ 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 \ +RUN /bin/echo -e "Name=server\\nAddressFamily=ipv4\\nInterface=tun0" > tinc.conf \ + && /bin/echo -e "Subnet=$ADDRESS\\nSubnet=0.0.0.0/0" > hosts/server \ + && /bin/echo -e "\\n" | tincd -n $NETNAME -K4096 \ + && /bin/echo -e "ifconfig \$INTERFACE $ADDRESS netmask $NETMASK" > 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 + --pidfile $PIDFILE \ + --debug $VERBOSE +