Docker image for Psiphon
Psiphon is an Internet censorship circumvention system.
This docker image runs the ConsoleClient from the psiphon-tunnel-core.
This build uses
docker buildx
plugin withdocker-container
driver.
Docker image available at swarupsengupta2007/psiphon.
# Clone this repo
git clone https://github.com/swarupsengupta2007/psiphon-docker
- Ensure buildx is enabled for docker
- Create a builder instance for multi-arch
- Build docker image for current platform or multi-arch
# choose target platforms
TARGETS="linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6"
# Create a builder instance if it doesn't exist
docker buildx create --name cross-platform --platform ${TARGETS} --use
# Build for current platform and load to docker image
docker buildx build -t <your_tag> . --load
# If not already done, install the required cross-platform emulators
docker run --privileged --rm tonistiigi/binfmt --install all
# run the script, this will build the image for current platform and load it to docker
./make.bash --load
Build-args available
build-arg | Description | Default |
---|---|---|
VERSION | psiphon-tunnel-core release version | latest |
TARGETS | <BUIDLOS>/<BUILDARCH> (Targets for cross-compilation for the build stage) | current platform |
GO_VERSION | Go version to use for building the psiphon-tunnel-core binary | 1.22.7 |
version: "3.5"
services:
psiphon:
image: swarupsengupta2007/psiphon:latest
container_name: psiphon
environment:
- PUID=1000
- PGID=1000
- HTTP_PORT=8080
- SOCKS_PORT=1080
- DEVICE_REGION=IN
- EGRESS_REGION=SG
volumes:
- /path/to/psiphon/config:/config
ports:
- 1080:1080
- 8080:8080
restart: unless-stopped
docker run -d \
--name psiphon \
--restart=unless-stopped \
-p 8080:8080 \
-p 1080:1080 \
-e HTTP_PORT=8080 \
-e SOCKS_PORT=1080 \
-e DEVICE_REGION=IN \
-e EGRESS_REGION=SG \
-v /home/swarup/psiphon/config/:/config \
swarupsengupta2007/psiphon
The following Environment var are available (only applicable when running for the first tome with no psiphon.config in the mounted config directory)
ENV variable | Description | Default |
---|---|---|
PUID | The UID for psiphon process | 1000 |
PGID | The GID for psiphon process | 1000 |
HTTP_PORT | The HTTP proxy port | 8080 |
SOCKS_PORT | The SOCKS proxy port | 1080 |
DEVICE_REGION | The device region for psiphon client | IN |
EGRESS_REGION | The egress region for psiphon client | SG |
The psiphon client configuration is stored in the mounted config directory. /config must be mounted and writable by the psiphon process.
The container has a healthcheck script that checks if the psiphon client is running and healthy.
You can check the health status of the container using the following command:
docker inspect --format='{{json .State.Health}}' psiphon