Use alpine and build tor from source

This commit is contained in:
Christophe Mehay 2016-09-23 23:57:58 +02:00
parent 5463744e49
commit 38ba81f386
8 changed files with 71 additions and 23 deletions

View file

@ -1,22 +1,39 @@
FROM debian:jessie
FROM alpine
ENV DEBIAN_FRONTEND=noninteractive
ENV HOME /var/lib/tor
ENV HOME /var/lib/tor
ENV TOR_VERSION 0.2.8.8
RUN apt-get update && apt-get install --no-install-recommends -y \
tor \
python3-pip
RUN apk add --no-cache git libevent-dev openssl-dev gcc make automake ca-certificates autoconf musl-dev && \
mkdir -p /usr/local/src/ && \
git clone https://git.torproject.org/tor.git /usr/local/src/tor && \
cd /usr/local/src/tor && \
git checkout tor-${TOR_VERSION} && \
./autogen.sh && ./configure --disable-asciidoc && make && make install && \
cd .. && \
rm -rf tor && \
apk add --no-cache python3 python3-dev && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --upgrade pip setuptools pycrypto && \
apk del git libevent-dev openssl-dev make automake python3-dev gcc autoconf musl-dev && \
apk add --no-cache libevent openssl
RUN pip3 install pyentrypoint==0.3.8
ADD assets/entrypoint-config.yml /
ADD assets/onions /usr/local/src/onions
ADD assets/torrc /var/local/tor/torrc.tpl
ADD assets/entrypoint-config.yml /
ADD assets/onions /usr/local/src/onions
ADD assets/torrc /etc/tor/torrc
RUN mkdir -p /etc/tor/
RUN cd /usr/local/src/onions && python3 setup.py install
RUN pip install pyentrypoint==0.3.8
RUN cd /usr/local/src/onions && python3 setup.py install
RUN mkdir -p ${HOME}/.tor && \
addgroup -S -g 107 tor && \
adduser -S -G tor -u 104 -H -h ${HOME} tor
VOLUME ["/var/lib/tor/hidden_service/"]
ENTRYPOINT ["pyentrypoint"]
CMD ["tor"]
CMD ["tor"]