Files
psiphon-docker/README.md
T

87 lines
2.7 KiB
Markdown
Raw Normal View History

2022-06-15 00:59:52 +05:30
# Psiphon Docker
2022-06-14 18:58:34 +05:30
Docker image for Psiphon
2022-06-15 00:59:52 +05:30
Psiphon is an Internet censorship circumvention system. <br>
This docker image runs the ConsoleClient from the [psiphon-tunnel-core](https://github.com/Psiphon-Labs/psiphon-tunnel-core "psiphon-tunnel-core").
2022-06-23 16:45:52 +05:30
> This build uses `docker buildx` plugin with `docker-container` driver. <br>
> Docker image available at [swarupsengupta2007/psiphon](https://hub.docker.com/r/swarupsengupta2007/psiphon "swarupsengupta2007/psiphon"). <br>
> This is built on base image from [swarupsengupta2007/apine-s6-docker](https://github.com/swarupsengupta2007/alpine-s6-docker "swarupsengupta2007/apine-s6-docker")
2022-06-15 11:29:57 +05:30
```bash
2022-06-15 01:12:15 +05:30
# Clone this repo
git clone https://github.com/swarupsengupta2007/psiphon-docker
```
2022-06-15 11:26:29 +05:30
# Building<br>
2022-06-15 00:59:52 +05:30
1. Ensure buildx is enabled for docker
2. Create a builder instance for multi-arch
3. Build docker image for current platform or multi-arch
2022-06-15 11:29:57 +05:30
```bash
2022-06-15 00:59:52 +05:30
# choose target platforms
2022-06-20 10:36:02 +05:30
TARGETS="linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6"
2022-06-15 00:59:52 +05:30
2022-06-23 16:45:52 +05:30
# Create a builder instance if it doesn't exist
2022-06-24 15:06:37 +05:30
docker buildx create --name cross-platform --platform ${TARGETS} --use
2022-06-15 00:59:52 +05:30
# Build for current platform and load to docker image
2022-06-24 15:06:37 +05:30
docker buildx build -t <your_tag> . --load
2022-06-15 00:59:52 +05:30
2022-06-23 16:45:52 +05:30
# build for multi-arch and push to registry
2022-06-24 15:06:37 +05:30
docker buildx build --build-arg TARGETS=${TARGETS} -t <your_username>/<your_tag> \
2022-06-15 01:20:59 +05:30
--platform ${TARGETS} . --push
2022-06-15 00:59:52 +05:30
```
2022-06-15 11:15:33 +05:30
2022-06-23 16:45:52 +05:30
Build-args available
|build-arg|default|Description|
|--|--|--|
|VERSION|2.0.23|psiphon-tunnel-core release version|
|TARGETS|\<BUIDLOS\>/\<BUILDARCH\>|Targets for cross-compilation for the build stage|
---
2022-06-15 11:15:33 +05:30
2022-06-15 11:26:29 +05:30
# Usage
2022-06-15 00:59:52 +05:30
2022-06-15 11:28:02 +05:30
## Using docker-compose (recommended) <br>
2022-06-15 01:24:32 +05:30
```yaml
2022-06-15 00:59:52 +05:30
version: "3.5"
services:
psiphon:
image: swarupsengupta2007/psiphon:latest
container_name: psiphon
environment:
- PUID=1000
- PGID=1000
volumes:
- /path/to/psiphon/config:/config
ports:
- 1080:1080
- 8080:8080
restart: unless-stopped
```
2022-06-15 11:28:02 +05:30
## Using docker-cli <br>
2022-06-15 11:29:57 +05:30
```bash
2022-06-24 15:06:37 +05:30
docker run -d \
--name psiphon \
--restart=unless-stopped \
-p 8080:8080 \
-p 1080:1080 \
-v /home/swarup/psiphon/config/:/config \
swarupsengupta2007/psiphon
2022-06-15 11:29:57 +05:30
```
2022-06-15 00:59:52 +05:30
2022-06-15 11:28:02 +05:30
The following Environment var are available<br>
2022-06-15 00:59:52 +05:30
|ENV variable|Description|Default|
|--|--|--|
|PUID|The UID for psiphon process|1000|
|PGID|The GID for psiphon process|1000|
Following ports and volumes are available
|Option|switch|Description|Default|
|--|--|--|--|
2022-06-20 10:36:02 +05:30
|HTTP PORT|-p <host_port>:8080|http proxy port|8080|
|SOCKS PORT|-p <host_port>:1080|socks proxy port|1080|
2022-06-15 00:59:52 +05:30
|VOLUME|-v /path/to/config:/config|The container storage|/config|