1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-20 22:08:39 +00:00
This commit is contained in:
kev 2015-06-14 11:48:08 +08:00
parent 1eab8a8d51
commit 19e34e276d

@ -6,6 +6,10 @@ FROM debian:jessie
MAINTAINER kev <noreply@datageek.inf>
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