65d6b97bf018c6fd3f9a258130b310190d8af442
Updated CI/CD workflow to check Docker Hub for existing tags and modified permissions.
Psiphon Docker
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 the
docker buildxplugin with thedocker-containerdriver.
Docker image available at swarupsengupta2007/psiphon.
# Clone this repo
git clone https://github.com/swarupsengupta2007/psiphon-docker
Building
- 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 the 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 the current platform and load it to Docker
./make.bash --load
| 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 |
Build-args available
Usage
Using docker-compose (recommended)
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
Using docker-cli
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 time 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 |
Configuration
The Psiphon client configuration is stored in the mounted config directory. /config must be mounted and writable by the psiphon process.
Healthcheck
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
Languages
Shell
87%
Dockerfile
13%