openvpn-tunnel
Lightweight OpenVPN tunnel with proxy, PAC routing, and built-in SSH jump host
1.0K
A lightweight, multi-purpose OpenVPN tunnel container.

This image bundles:
It is ideal for:
.ovpn supported (OpenVPN runs inside /vpn)PROXY_HOSTS/vpn (required)Contains:
myvpn.ovpn
cacert.pem
client_crt.pem
client_key.pem
ta.key
/ssh.pub (required)Mount a single public key file, e.g.:
- ~/.ssh/id_ed25519.pub:/ssh.pub:ro
It gets written to /root/.ssh/authorized_keys.
| Container | Purpose |
|---|---|
| 80 | PAC file via nginx |
| 8888 | tinyproxy |
| 22 | SSH jump host |
Example mapping:
8080:80 → PAC
8888:8888 → HTTP Proxy
2222:22 → SSH Jump Host
PROXY_HOSTS — comma-separated list of domains (e.g. .example.com,.corp.local)PAC_PROXY_HOST — usually localhostPAC_PROXY_PORT — port used by tinyproxy on hostTINYPROXY_PORT — internal tinyproxy port (default 8888)SSH_PORT — SSH port inside container (default 22)SSH_PUBLIC_KEY_FILE — path to mounted pubkey (/ssh.pub)services:
openvpn-tunnel:
image: martinbuchheim/openvpn-tunnel:latest
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
volumes:
- ~/vpn-configs/example:/vpn:ro
- ~/.ssh/id_ed25519.pub:/ssh.pub:ro
environment:
PROXY_HOSTS: "example.com"
PAC_PROXY_HOST: "localhost"
PAC_PROXY_PORT: "8888"
ports:
- "8080:80"
- "8888:8888"
- "2222:22"
Configure in your browser:
http://localhost:8080/proxy.pac
Domains listed in PROXY_HOSTS route through the VPN-backed proxy.
Example ~/.ssh/config:
Host example-jump
HostName localhost
Port 2222
User root
Host example-git
HostName git.example.com
User git
ProxyJump example-jump
Usage:
ssh example-git
Content type
Image
Digest
sha256:2d347be83…
Size
9.5 MB
Last updated
4 months ago
docker pull martinbuchheim/openvpn-tunnel