Sign inSign up

anonymouz/openvpn-client

By anonymouz

•Updated 4 months ago

Maintainable Alpine-based OpenVPN client for Docker.

Image
Networking
Security
1

1.0K

anonymouz/openvpn-client repository overview

⁠OpenVPN Client (Multi-arch)

Build Status Security Scanned

Maintainable Alpine-based OpenVPN client for Docker.

⁠Security First

This image is automatically rebuilt every week to include the latest security patches from the Alpine community. You can view the detailed vulnerability reports in the GitHub Security Tab⁠.

  • Base OS: Alpine 3.x
  • Multi-arch: linux/amd64, linux/arm64
  • Init: tini
  • Privilege management: su-exec

⁠Key Improvements in this Fork

  • Base Image: Switched to Alpine 3.x for a minimal footprint (~20MB).
  • Architecture: Native support for amd64 and arm64 (Apple Silicon, Raspberry Pi, etc.).
  • Security: Replaced the aging shadow suite and sg tool with the lightweight su-exec.

⁠Usage

This image is ideal for routing traffic from other containers through a VPN tunnel.

services:
  vpn:
    image: anonymouz/openvpn-client
    container_name: vpn
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    volumes:
      - ./client.ovpn:/vpn/config.ovpn:ro
    restart: always

  webapp:
    image: nginx
    network_mode: "service:vpn"
    depends_on:
      - vpn

⁠Configuration

⁠Environment Variables
  • ROUTE: Add custom routes (e.g., -e ROUTE="192.168.31.0/24").
  • DNS: Set custom DNS servers (e.g., -e DNS="1.1.1.1").
⁠Routing & Split Tunneling

To ignore the default gateway pushed by the server and use specific routes instead, you can pass the -f flag (equivalent to route-nopull):

docker run -it --cap-add=NET_ADMIN --device /dev/net/tun \
  -v $(pwd)/client.ovpn:/vpn/config.ovpn:ro \
  anonymouz/openvpn-client -f -r "192.168.31.0/24"

⁠Troubleshooting

If you encounter issues with connectivity, ensure:

  1. The --cap-add=NET_ADMIN flag is present.
  2. The /dev/net/tun device is mapped.
  3. Your .ovpn file is named config.ovpn inside the /vpn volume (or correctly pointed to).

⁠Contributing

Feel free to open issues or pull requests at the GitHub Repository⁠.

Tag summary

Content type

Image

Digest

sha256:686823fca…

Size

8.3 MB

Last updated

4 months ago

docker pull anonymouz/openvpn-client