From 0748083b2e61982108ad8c7375eaa6bef2ea4daa Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Sun, 19 Apr 2015 11:58:28 +0200 Subject: Add dockerfile for Tor onion services. --- packaging/docker/onion/Dockerfile | 11 +++++++++++ packaging/docker/onion/start.sh | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100644 packaging/docker/onion/Dockerfile create mode 100644 packaging/docker/onion/start.sh (limited to 'packaging/docker') diff --git a/packaging/docker/onion/Dockerfile b/packaging/docker/onion/Dockerfile new file mode 100644 index 0000000..c1cadcd --- /dev/null +++ b/packaging/docker/onion/Dockerfile @@ -0,0 +1,11 @@ +FROM debian:jessie +RUN apt-get update +RUN echo 'debconf debconf/frontend select noninteractive' | debconf-set-selections +RUN apt-get -y -q install tor +RUN systemctl disable tor +ADD start.sh /start.sh +RUN chmod a+rx /start.sh +VOLUME /etc/tor +VOLUME /var/lib/tor/hs +RUN chown -R debian-tor:debian-tor /var/lib/tor/hs +ENTRYPOINT ["/start.sh"] diff --git a/packaging/docker/onion/start.sh b/packaging/docker/onion/start.sh new file mode 100644 index 0000000..afc70f7 --- /dev/null +++ b/packaging/docker/onion/start.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +if ! [ -e /etc/tor/torrc ]; then + echo "SocksPort 0" >> /etc/tor/torrc + echo "DataDirectory /var/lib/tor" >> /etc/tor/torrc + echo "HiddenServiceDir /var/lib/tor/hs" >> /etc/tor/torrc + echo "HiddenServicePort 80" >> /etc/tor/torrc +fi + +/usr/bin/tor -f /etc/tor/torrc --user debian-tor -- cgit v1.1