-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from bugfest/improvements
Quick and default builds
- Loading branch information
Showing
5 changed files
with
129 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
ARG ALPINE_VERSION="3.17.3" | ||
|
||
# Build the obfs4 binary (cross-compiling) | ||
FROM --platform=$BUILDPLATFORM golang:1.20-alpine as obfs-builder | ||
ARG OBFS_VERSION="obfs4proxy-0.0.14-tor2" | ||
|
||
RUN apk add --update --no-cache git | ||
RUN git clone https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/obfs4.git --depth 1 --branch $OBFS_VERSION /obfs | ||
|
||
# Build obfs | ||
RUN mkdir /out | ||
WORKDIR /obfs | ||
ARG TARGETOS TARGETARCH | ||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg \ | ||
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /out/obfs4proxy ./obfs4proxy | ||
|
||
# Tor runner | ||
FROM --platform=$TARGETPLATFORM docker.io/library/alpine:$ALPINE_VERSION as runner | ||
ARG TOR_VERSION="0.4.7.13" | ||
|
||
LABEL \ | ||
org.opencontainers.image.source "https://github.com/bugfest/tor-docker" | ||
|
||
WORKDIR /app | ||
|
||
RUN apk add --update --no-cache \ | ||
tor=~${TOR_VERSION} && \ | ||
chmod -R g+w /app /run | ||
|
||
# install transports | ||
COPY --from=obfs-builder /out/obfs4proxy /usr/local/bin/. | ||
|
||
USER 1001 | ||
|
||
ENTRYPOINT ["tor"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
.PHONY: all | ||
all: build | ||
|
||
.PHONY: build | ||
.PHONY: quick | ||
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 \ | ||
--tag quay.io/bugfest/tor:latest \ | ||
--squash \ | ||
-f Dockerfile.quick \ | ||
. | ||
|
||
.PHONY: build-alt | ||
.PHONY: build | ||
build-alt: | ||
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 \ | ||
--tag quay.io/bugfest/tor:latest \ | ||
--squash \ | ||
-f Dockerfile.build . | ||
-f Dockerfile \ | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,56 @@ | ||
# tor-docker | ||
<h1 align="center"><b>tor-docker</b></h1> | ||
|
||
Tor multiarch dockerfile | ||
|
||
[![Build multiarch image - latest](https://github.com/bugfest/tor-docker/actions/workflows/main.yml/badge.svg)](https://github.com/bugfest/tor-docker/actions/workflows/main.yml) | ||
[![Build multiarch image - tag](https://github.com/bugfest/tor-docker/actions/workflows/main-tag.yml/badge.svg)](https://github.com/bugfest/tor-docker/actions/workflows/main-tag.yml) | ||
|
||
`Tor` daemon (https://www.torproject.org/download/tor/) multiarch container. | ||
|
||
Additional transport plugins included in the image: | ||
- `obfs4proxy` | ||
|
||
Tested architectures: | ||
|
||
- amd64 | ||
- arm | ||
- arm64 | ||
- `amd64` | ||
- `arm` | ||
- `arm64` | ||
|
||
Source code: | ||
- https://gitlab.torproject.org/tpo/core/tor | ||
- https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/obfs4 | ||
|
||
Used by: | ||
- [bugfest/tor-controller](https://github.com/bugfest/tor-controller) | ||
|
||
Used by [bugfest/tor-controller](https://github.com/bugfest/tor-controller) | ||
# Tor | ||
|
||
Tor is an anonymity network that provides: | ||
|
||
- privacy | ||
- enhanced tamperproofing | ||
- freedom from network surveillance | ||
- NAT traversal | ||
|
||
## How to | ||
|
||
## Standard build | ||
|
||
Builds Tor from source. Method used to create releases in this repo. | ||
|
||
```bash | ||
make | ||
``` | ||
|
||
## Quick build | ||
|
||
Installs pre-built Tor from Alpine's repositories. Useful for testing/troubleshooting. | ||
|
||
```bash | ||
make quick | ||
``` | ||
|
||
# Usage | ||
|
||
```shell | ||
docker pull quay.io/bugfest/tor | ||
``` |