Skip to content

Commit

Permalink
Dockerfile (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
svengo authored Sep 20, 2023
1 parent a6ed334 commit d5c82c4
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ FROM alpine:3.18.3
# Build-time variables
ARG TOR_VERSION=0.4.8.6
ARG TZ=Europe/Berlin
ARG BUILD_DATE
ARG VCS_REF
ARG CURL_OPTIONS="--no-progress-meter --fail --location --remote-name"

WORKDIR /tmp

RUN \
echo "::group::Install required packages" && \
set -o xtrace && \
if test -z "$TOR_VERSION" ; then echo ERROR: TOR_VERSION not provided && exit 1; fi && \
\
apk update && \
apk add \
curl \
Expand All @@ -34,7 +30,10 @@ RUN \
xz-dev \
zlib-dev \
zstd-dev && \
echo "::endgroup::" && \
\
echo "::group::Download Tor" && \
CURL_OPTIONS="--no-progress-meter --fail --location --remote-name" && \
curl ${CURL_OPTIONS} "https://dist.torproject.org/tor-${TOR_VERSION}.tar.gz" && \
curl ${CURL_OPTIONS} "https://dist.torproject.org/tor-${TOR_VERSION}.tar.gz.sha256sum" && \
curl ${CURL_OPTIONS} "https://dist.torproject.org/tor-${TOR_VERSION}.tar.gz.sha256sum.asc" && \
Expand All @@ -43,8 +42,10 @@ RUN \
nickm@torproject.org && \
sha256sum -c "tor-${TOR_VERSION}.tar.gz.sha256sum" && \
gpg --verify "tor-${TOR_VERSION}.tar.gz.sha256sum.asc" && \
\
tar -zxf "tor-${TOR_VERSION}.tar.gz" && \
echo "::endgroup::" && \
\
echo "::group::Configure" && \
cd tor-${TOR_VERSION} && \
./configure \
--sysconfdir=/etc \
Expand All @@ -57,16 +58,30 @@ RUN \
--enable-lzma \
--enable-zstd \
--silent && \
echo "::endgroup::" && \
\
echo "::group::Build" && \
CFLAGS=-Wno-cpp make && \
echo "::endgroup::" && \
\
echo "::group::Test" && \
make test && \
echo "::endgroup::" && \
\
echo "::group::Install" && \
make install && \
echo "::endgroup::" && \
\
echo "::group::Cleanup" && \
apk del build && \
rm -rf /tmp/* && \
rm -rf /var/cache/apk/* && \
echo "::endgroup::" && \
\
echo "::group::Add tor user and group" && \
addgroup -S tor && \
adduser -s /bin/false -SDH -G tor tor
adduser -s /bin/false -SDH -G tor tor && \
echo "::endgroup::"

VOLUME /data
WORKDIR /data
Expand Down

0 comments on commit d5c82c4

Please sign in to comment.