🐳 Toron Edge Gateway — Docker Containerization Guide

Toron Edge Gateway is packaged as a multi-stage, ultra-lightweight Docker appliance (~15 MB image size) based on Alpine Linux with zero third-party runtime dependencies.


⚡ Quickstart Container Commands

Pulling Pre-Built Multi-Arch Images (linux/amd64, linux/arm64)

Official multi-architecture images are published to both GitHub Packages Container Registry (GHCR) and Docker Hub on every release:

# Pull from GitHub Packages (GHCR)
docker pull ghcr.io/sayantansaha/toron:latest
docker pull ghcr.io/sayantansaha/toron:1.6

# Or pull from Docker Hub
docker pull sayantansaha/toron:latest
docker pull sayantansaha/toron:1.6

Running the Container

# Run Toron container with Docker socket auto-discovery
docker run -d \
  --name toron-gateway \
  -p 8080:8080 \
  -p 8443:8443 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v $(pwd)/config.yaml:/etc/toron/config.yaml:ro \
  -v $(pwd)/routes.yaml:/etc/toron/routes.yaml:ro \
  ghcr.io/sayantansaha/toron:latest

Building Locally

# Build the Toron Docker image using Makefile
make docker-build

# Or build directly with Docker CLI
docker build -t toron:latest .

🏗️ Multi-Stage Docker Architecture

  1. Stage 1 (builder): Uses golang:alpine to statically compile cmd/toron/main.go with CGO_ENABLED=0 GOOS=linux, embedding canonical version metadata via linker flags (-ldflags).
  2. Stage 2 (runner): Uses alpine:latest with CA certificates (ca-certificates), timezone data (tzdata), /etc/toron default configuration, and static Web Control Center UI files (/etc/toron/public/). Includes OCI image labels.

🔌 Exposed Container Ports

Port Protocol Description
8080 HTTP Primary HTTP Gateway & Web Control Center Dashboard
8443 HTTPS TLS 1.2/1.3 Gateway & Automated ACME Endpoint
8090 TCP Layer 4 Stream Proxy Port
8091 UDP Layer 4 Datagram Proxy Port

🐳 Docker Compose Deployment

Toron can be run alongside containerized upstream microservices using docker compose:

version: '3.8'

services:
  toron:
    image: ghcr.io/sayantansaha/toron:latest
    container_name: toron-edge-gateway
    ports:
      - "8080:8080"
      - "8443:8443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./config.yaml:/etc/toron/config.yaml
      - ./routes.yaml:/etc/toron/routes.yaml
    restart: always
Toron · তোরণ GitHub