From 389277b17534b3c85c9d7caed98155f95372d0bb Mon Sep 17 00:00:00 2001 From: Stafford Brunk Date: Wed, 21 Jan 2015 09:44:46 -0700 Subject: [PATCH] Initial commit of iodine Dockerfile --- CHANGELOG.md | 10 ++++++++++ Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ README.md | 13 +++++++++++++ iodined.sh | 9 +++++++++ 4 files changed, 68 insertions(+) create mode 100644 CHANGELOG.md create mode 100644 Dockerfile create mode 100644 README.md create mode 100755 iodined.sh diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..d623d61 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +### v1.3 +* Remove copying of `authorized_keys` into image +* Use `passenger/baseimage` v0.9.16 +* Run `apt-get update` before installing `net-tools` and `iodine` +* Add ENV variable to configure tunnel IP + +### v1.2 +* Initial import of [FiloSottile/Dockerfiles/iodine](https://github.com/FiloSottile/Dockerfiles/tree/master/iodine) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5f70d05 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +################################################# +# +# Iodine Dockerfile v1.3 +# http://code.kryo.se/iodine/ +# +# Based on https://github.com/FiloSottile/Dockerfiles/blob/master/iodine/Dockerfile +# +# Run with: +# sudo docker run --privileged -p 53:53/udp -e IODINE_HOST=t.example.com -e IODINE_PASSWORD=1234abc wingrunr21/iodine +# +################################################# + +# Use phusion/baseimage as base image. +FROM phusion/baseimage:0.9.16 + +MAINTAINER Stafford Brunk + +# Set environment variables and regen SSH host keys +ENV HOME /root +RUN /etc/my_init.d/00_regen_ssh_host_keys.sh + +# Install iodine +RUN apt-get update && apt-get install -y net-tools iodine + +# Add the runit iodine service +RUN mkdir /etc/service/iodined +ADD iodined.sh /etc/service/iodined/run + +# Expose the DNS port, remember to run -p 53:53/udp +EXPOSE 53/udp + +# Use baseimage-docker's init system. +CMD ["/sbin/my_init"] + +# Clean up APT when done. +RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/README.md b/README.md new file mode 100644 index 0000000..5c2495b --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# iodine-docker + +Docker image for [Iodine](http://code.kryo.se/iodine/) + +## Usage + + docker pull wingrunr21/iodine + docker run -d --privileged -p 53:53/udp -e IODINE_HOST=t.example.com -e IODINE_PASSWORD=1234password wingrunr21/iodine + +### Environment Variables +* `IODINE_HOST` - the domain where your iodine server is running +* `IODINE_PASSWORD` - the password for your iodine server +* `IODINE_TUNNEL_IP` - the server tunnel ip. Optional and defaults to 10.0.0.1. diff --git a/iodined.sh b/iodined.sh new file mode 100755 index 0000000..943ecf5 --- /dev/null +++ b/iodined.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +TUNNEL_IP=${IODINE_TUNNEL_IP:-"10.0.0.1"} + +# Thanks to https://github.com/jpetazzo/dockvpn for the tun/tap fix +mkdir -p /dev/net +mknod /dev/net/tun c 10 200 + +exec iodined -c -f $TUNNEL_IP $IODINE_HOST -P $IODINE_PASSWORD >>/var/log/iodined.log 2>&1