Tor Browser Bundle and Tor running in docker containers.
446
This is a set of Docker containers, one which runs Tor with a SocksPort, ControlPort, and Cookie-based authentication, the other which runs a Tor Browser Bundle configured to use the Tor-hosting docker container. This is an entirely unofficial effort with no endorsement or guarantee from anyone, least of all a reputable organization like the Tor Project.
This dockerfile downloads and configures a Tor Browser Bundle from the latest version recommended by the Tor Project. It makes the environment variables that can configure the Tor Browser Bundle available to docker build and docker run.
FROM debian:sid
ARG TOR_CONTROL_HOST=127.0.0.1
ARG TOR_CONTROL_PORT=9151
ARG TOR_SOCKS_HOST=127.0.0.1
ARG TOR_SOCKS_PORT=9150
ARG TOR_FORCE_NET_CONFIG=0
ARG TOR_SKIP_LAUNCH=1
ARG TOR_SKIP_CONTROLPORTTEST=1
ARG UPDATE_URL=https://www.torproject.org/projects/torbrowser/RecommendedTBBVersions
ENV DEBIAN_FRONTEND=noninteractive \
HOME=/home/anon \
TOR_CONTROL_PORT=$TOR_CONTROL_PORT \
TOR_CONTROL_HOST=$TOR_CONTROL_HOST \
TOR_SOCKS_PORT=$TOR_SOCKS_PORT \
TOR_SOCKS_HOST=$TOR_SOCKS_HOST \
TOR_SKIP_LAUNCH=$TOR_SKIP_LAUNCH \
TOR_SKIP_CONTROLPORTTEST=$TOR_SKIP_CONTROLPORTTEST \
UPDATE_URL=https://www.torproject.org/projects/torbrowser/RecommendedTBBVersions
RUN apt-get update && apt-get install -y gnupg curl xz-utils
RUN apt-key --keyring /etc/apt/trusted.gpg.d/whonix.gpg adv --keyserver hkp://pool.sks-keyservers.net --recv-keys 916B8D99C38EAF5E8ADC7A2A8D66066A2EEACCDA
RUN echo "deb http://deb.whonix.org stretch main" | tee /etc/apt/sources.list.d/whonix.list
RUN apt-get update && \
apt-get -y dist-upgrade && \
sed -i.bak 's/sid main/sid main contrib/g' /etc/apt/sources.list && \
apt-get update && apt-get install -y \
gnupg \
zenity \
ca-certificates \
xz-utils \
curl \
iceweasel \
file \
libgtkextra-dev \
--no-install-recommends && \
localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 || :
RUN groupadd -g 1000 anon
RUN useradd -m -g 1000 -u 1000 -d /home/anon anon
RUN mkdir /home/anon/.local
USER anon
WORKDIR /home/anon
RUN BROWSER_VERSION=$(curl $UPDATE_URL 2> /dev/null | grep -vi macos | grep -vi windows | grep -vi linux | head -n 2 | tail -n 1 | tr -d '",') && curl -sSL -o /home/anon/tor.tar.xz \
https://www.torproject.org/dist/torbrowser/${BROWSER_VERSION}/tor-browser-linux64-${BROWSER_VERSION}_en-US.tar.xz
RUN BROWSER_VERSION=$(curl $UPDATE_URL 2> /dev/null | grep -vi macos | grep -vi windows | grep -vi linux | head -n 2 | tail -n 1 | tr -d '",') && curl -sSL -o /home/anon/tor.tar.xz.asc \
https://www.torproject.org/dist/torbrowser/${BROWSER_VERSION}/tor-browser-linux64-${BROWSER_VERSION}_en-US.tar.xz.asc
RUN gpg --keyserver ha.pool.sks-keyservers.net \
--recv-keys "EF6E 286D DA85 EA2A 4BA7 DE68 4E2C 6E87 9329 8290"
RUN gpg --verify /home/anon/tor.tar.xz.asc
RUN tar xf /home/anon/tor.tar.xz
RUN rm -f /home/anon/tor.tar.xz*
USER root
RUN chown -R anon:anon /home/anon/.local/ && \
chmod -R o+rw /home/anon/.local/
USER anon
CMD /home/anon/tor-browser_en-US/Browser/start-tor-browser
This approach has the distinct advantage of making it extremely easy to ensure an up-to-date Tor Browser Bundle is always available. However, I have used it less and think of it as experimental for now.
FROM eyedeekay/whonix
USER root
RUN apt-get update && apt-get dist-upgrade -y
RUN apt-get install -y tb-starter tb-updater
USER user
WORKDIR /home/user
CMD update-torbrowser --devbuildpassthrough && torbrowser
FROM alpine:3.7
ARG TOR_CONTROL_HOST=172.70.70.2
ARG TOR_CONTROL_PORT=9151
ARG TOR_SOCKS_HOST=172.70.70.2
ARG TOR_SOCKS_PORT=9150
RUN apk update && apk add tor
COPY torrc /etc/tor/torrc
RUN sed -i "s|172.70.70.2|$TOR_CONTROL_HOST|g" /etc/tor/torrc
RUN sed -i "s|9151|$TOR_CONTROL_PORT|g" /etc/tor/torrc
RUN sed -i "s|172.70.70.2|$TOR_SOCKS_HOST|g" /etc/tor/torrc
RUN sed -i "s|9150|$TOR_SOCKS_PORT|g" /etc/tor/torrc
RUN mkdir -p /var/lib/tor
RUN chown -R tor /var/lib/tor
RUN chmod -R 2700 /var/lib/tor
RUN chmod -R o+rw /var/lib/tor
USER tor
CMD tor -f /etc/tor/torrc
I'm a a big fan of Snowflake, conceptually, hopefully someday soon I'll be able to develop the skills required to help make it suitable for inclusion in the mainline TBB. Tgus container sets up a Snowflake PT for Tor to use on a pre-configured container. Be aware that Snowflake is still considered experimental by TPO and they know what they are doing.
make browse
Content type
Image
Digest
Size
110.8 MB
Last updated
almost 8 years ago
docker pull eyedeekay/tbb-docker:tor