How leleobhz/snx-rs-docker works
Project Type and Purpose
• This is a container-based distribution of the “snx-rs” VPN client.
• It provides multi-architecture images (amd64, arm64, armv6) that users can pull from Quay.io and run via Podman.
• The container wraps the snx-rs binary along with required tun device, modules, and scripts.
File Structure
• Containerfile, Containerfile.armv6 – Docker/Buildah recipes for standard and armv6 builds.
• Makefile – orchestrates build commands, version retrieval (get_latest_version.sh), and pushes to the registry (get_container_auth.sh).
• get_latest_version.sh/get_container_auth.sh – helper scripts to fetch the upstream snx-rs release and registry credentials.
• README.md – usage instructions, supported architectures, run options, performance notes.
README for Insights
• Usage snippet shows how the container is run (privileged, /dev/net/tun, module mounts, PODMAN flags).
• Mentions target hosts (Raspberry Pi 1, amd64) and performance.
• Identifies the container registry (quay.io/pqatsi/snx-rs) and the tags model (latest, per-arch).
a. Build-Time Pipeline
– Developer Repo (GitHub)
– CI/CD Runner (e.g., GitHub Actions / Make)
– Scripts: get_latest_version.sh, get_container_auth.sh
– Build Engine (Podman/Buildah) running Containerfile and Containerfile.armv6
– Multi-arch Image Builder (manifest lists for amd64, arm64, armv6)
– Container Registry (quay.io/pqatsi/snx-rs)
b. Run-Time Environment
– Host OS / Device (x86, Raspberry Pi)
– Container Runtime (Podman)
– Container Instance
• snx-rs binary
• Tun/Tap device (/dev/net/tun)
• Module mount (/lib/modules:ro)
– Local Volume for sessions (/opt/snx/sessions → /var/cache/snx-rs/sessions)
– Network Namespace (–network=host, NET_ADMIN/SYS_ADMIN)
– External VPN Server (IPSec endpoint)
Relationships and Data Flows
• Annotation showing privileged capabilities (NET_ADMIN, SYS_ADMIN).
Architectural Patterns and Principles
• Single-purpose, immutable container image (one process per container).
• Multi-arch build using separate Containerfiles and a manifest list.
• Minimal base OS layers, runtime isolation via host network namespace.
• Scripts externalize versioning and registry authentication (separation of concerns).
Key Technologies and Frameworks
• Podman / Buildah (OCI-compliant builds & runs)
• Containerfile (Dockerfile-compatible)
• Makefile (build orchestration)
• Quay.io (registry)
• Bash scripts for automation
• snx-rs VPN client (Rust binary)