Skip to content

Commit

Permalink
Update tor version to 0.4.8.7 (#6)
Browse files Browse the repository at this point in the history
* Update tor to 0.4.8.7
* Upgrade Alpine to 3.18.4. Enable GPL flag during Tor build

---------

Co-authored-by: BugFest <[email protected]>
  • Loading branch information
MaticPoh and bugfest authored Nov 1, 2023
1 parent 1089c0f commit cee3c23
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
17 changes: 12 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG ALPINE_VERSION="3.17.3"
ARG ALPINE_VERSION="3.18.4"

# Tor builder
FROM --platform=$TARGETPLATFORM docker.io/library/alpine:$ALPINE_VERSION as tor-builder

ARG TOR_VERSION="0.4.7.13"
ARG TOR_VERSION="0.4.8.7"
RUN apk add --update --no-cache \
git build-base automake autoconf make \
build-base openssl-dev libevent-dev zlib-dev \
Expand All @@ -13,10 +13,14 @@ RUN apk add --update --no-cache \
RUN git clone https://gitlab.torproject.org/tpo/core/tor.git --depth 1 --branch tor-$TOR_VERSION /tor
WORKDIR /tor
RUN ./autogen.sh

# Notes:
# - --enable-gpl is required to compile PoW anti-DoS: https://community.torproject.org/onion-services/advanced/dos/
RUN ./configure \
--disable-asciidoc \
--disable-manpage \
--disable-html-manual
--disable-html-manual \
--enable-gpl
# --enable-static-tor
RUN make
RUN make install
Expand Down Expand Up @@ -44,8 +48,11 @@ LABEL \

WORKDIR /app

RUN apk add --update --no-cache libevent && \
chmod -R g+w /app /run
RUN apk add --update --no-cache \
libevent \
xz-libs \
zstd-libs \
&& chmod -R g+w /app /run

# install tor
RUN mkdir -p /usr/local/bin /usr/local/etc/tor /usr/local/share/tor
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.quick
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG ALPINE_VERSION="3.17.3"
ARG ALPINE_VERSION="3.18.4"

# Build the obfs4 binary (cross-compiling)
FROM --platform=$BUILDPLATFORM golang:1.20-alpine as obfs-builder
Expand All @@ -17,7 +17,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \

# Tor runner
FROM --platform=$TARGETPLATFORM docker.io/library/alpine:$ALPINE_VERSION as runner
ARG TOR_VERSION="0.4.7.13"
ARG TOR_VERSION="0.4.8.7"

LABEL \
org.opencontainers.image.source "https://github.com/bugfest/tor-docker"
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
.PHONY: all
all: build

# Dockerfile.quick installs Tor using pre-built binaries
.PHONY: quick
build:
quick:
docker buildx build \
--platform=linux/amd64,linux/arm,linux/arm64 \
--build-arg ALPINE_VERSION=3.17.3 \
--build-arg TOR_VERSION=0.4.7.13 \
--tag quay.io/bugfest/tor:0.4.7.13 \
--build-arg TOR_VERSION=0.4.8.7 \
--tag quay.io/bugfest/tor:0.4.8.7 \
--tag quay.io/bugfest/tor:latest \
--squash \
-f Dockerfile.quick \
.

# Dockerfile builds Tor from source
.PHONY: build
build-alt:
build:
docker buildx build \
--platform=linux/amd64,linux/arm,linux/arm64 \
--build-arg ALPINE_VERSION=3.17.3 \
--build-arg TOR_VERSION=0.4.7.13 \
--tag quay.io/bugfest/tor:0.4.7.13 \
--build-arg TOR_VERSION=0.4.8.7 \
--tag quay.io/bugfest/tor:0.4.8.7 \
--tag quay.io/bugfest/tor:latest \
--squash \
-f Dockerfile \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ make

Installs pre-built Tor from Alpine's repositories. Useful for testing/troubleshooting.

WARNING: some Tor features might be missing, depending on the [Alpine community build setup](https://github.com/alpinelinux/aports/tree/master/community/tor)

```bash
make quick
```
Expand Down

0 comments on commit cee3c23

Please sign in to comment.