[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-dev] Fwd: [PATCH]: Add Dockerfile



Hi!

I made a patch for running tor and/or the tor development tests in a
Dockerfile. Attached is the patch and if approved you can pull from
https://github.com/jfrazelle/tor.git, branch: add-dockerfile

This would make running the tor test suite as easy as:

docker build -t tor .
docker run tor make check

You can also run tor with:

docker run tor

Thanks!

--


Jessie Frazelle
4096R / D4C4 DD60 0D66 F65A 8EFCÂ 511E 18F3 685C 0022 BFF3
pgp.mit.edu



--


Jessie Frazelle
4096R / D4C4 DD60 0D66 F65A 8EFC Â511E 18F3 685C 0022 BFF3
pgp.mit.edu


From fbdb0b79606a812c4070fefaf98c47b254b4c106 Mon Sep 17 00:00:00 2001
From: Jessica Frazelle <princess@xxxxxxxxxx>
Date: Fri, 12 Jun 2015 13:18:42 -0700
Subject: [PATCH] Add Dockerfile.

You can use this by running:

To build the image:
docker build -t tor .

To run tor:
docker run tor

To run the tests:
docker run tor make check

Signed-off-by: Jessica Frazelle <jess@xxxxxxxxx>
---
 Dockerfile | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 Dockerfile

diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..67feb14
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,57 @@
+# VERSION:		  0.1
+# DESCRIPTION:	  Compile and run tor in a container 
+# AUTHOR:		  Jessica Frazelle <jess@xxxxxxxxxx>
+# COMMENTS:
+#	This file describes how to build and run tor 
+#	in a container with all dependencies installed.
+# USAGE:
+#	# Build tor image
+#	docker build -t tor .
+#	
+#	# Run tor
+#	docker run -p 9050:9050 tor
+#	
+#	# Run tor tests
+#	docker run tor make check
+
+# Base docker image
+FROM debian:jessie
+
+# Install dependencies
+RUN apt-get update && apt-get install -y \
+	asciidoc \
+	automake \
+	docbook-xsl \
+	docbook-xml \
+	gcc \
+	g++ \
+	libevent-dev \
+	libminiupnpc-dev \
+	libseccomp-dev \
+	libssl-dev \
+	make \
+	xmlto \
+	zlib1g-dev \
+	--no-install-recommends \
+	&& mkdir -p /usr/src/tor
+
+ENV HOME /home/tor
+RUN useradd --create-home --home-dir $HOME tor \
+    && chown -R tor:tor $HOME
+
+
+# Add source files
+COPY . /usr/src/tor
+WORKDIR /usr/src/tor
+
+# Compile & install tor
+RUN ./autogen.sh \
+	&& ./configure \
+	&& make \
+	&& make install \
+	&& chown -R tor:tor /usr/src/tor
+
+USER tor
+
+# set command as minimal default
+CMD [ "/usr/local/bin/tor", "-f", "/usr/src/tor/src/config/torrc.minimal" ]
-- 
2.4.3

_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev