Skip to content

Instantly share code, notes, and snippets.

@kking124
Last active June 21, 2019 15:50
Show Gist options
  • Save kking124/d6cb787aebf1096fa52e737990123a60 to your computer and use it in GitHub Desktop.
Save kking124/d6cb787aebf1096fa52e737990123a60 to your computer and use it in GitHub Desktop.
dockerfile to create a tor socks and http proxy using privoxy
FROM debian:stretch
LABEL maintainer=https://github.com/kking124 build=1.0.20190620 source=https://howto.biapy.com/en/debian-gnu-linux/servers/http/install-the-anonymizing-proxy-server-tor-on-debian
EXPOSE 8118 9050
RUN apt-get -y update && apt-get -y install lsb-release gnupg curl && \
echo deb http://deb.torproject.org/torproject.org stretch main > /etc/apt/sources.list.d/tor.list && \
echo deb-src http://deb.torproject.org/torproject.org stretch main >> /etc/apt/sources.list.d/tor.list && \
curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | apt-key add - && \
apt-get update && \
apt-get -y install curl tor deb.torproject.org-keyring privoxy && \
apt-get -y upgrade && \
rm -rf /var/lib/apt/lists/* && \
sed -i 's/^listen-address/#listen-address/' /etc/privoxy/config && \
echo "forward-socks4a / localhost:9050 ." >> "/etc/privoxy/config" && \
echo "listen-address :8118" >> "/etc/privoxy/config"
CMD service privoxy start; tor
@kking124
Copy link
Author

Usage

> docker build -t privoxy-tor:latest .
> docker run -p 8118:8118 -p 9050:9050 privoxy-tor 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment