在 Docker 中运行 Cloudflare WARP 客户端,对外暴露 SOCKS5 代理端口 40000。
Run the Cloudflare WARP client in Docker and expose a SOCKS5 proxy on port 40000.
启动容器后自动完成:注册客户端 → 切换 proxy 模式 → 连接 → 校验 warp=on。
On startup the container automatically: registers the client → switches to proxy mode → connects → verifies warp=on.
docker pull galtjay/warp:20261102
--cap-add NET_ADMIN,用于创建 WireGuard/MASQUE 隧道。
--cap-add NET_ADMIN is required to create the WireGuard/MASQUE tunnel.2408(WireGuard)与 8095(MASQUE/QUIC)。
Outbound UDP 2408 (WireGuard) and 8095 (MASQUE/QUIC) must be allowed.推荐使用 host 网络,因为代理默认只监听 127.0.0.1。
Host networking is recommended because the proxy only listens on 127.0.0.1 by default.
docker run -d \
--name warp \
--network host \
--cap-add NET_ADMIN \
galtjay/warp:20261102
| 变量 / Variable | 默认值 / Default | 说明 / Description |
|---|---|---|
WARP_PROXY_PORT | 40000 | 覆盖 SOCKS5 代理端口 / Override the SOCKS5 proxy port |
docker run -d \
--name warp \
--network host \
--cap-add NET_ADMIN \
-e WARP_PROXY_PORT=40000 \
galtjay/warp:20261102
services:
warp:
image: galtjay/warp:20261102
container_name: warp
network_mode: host
cap_add:
- NET_ADMIN
restart: unless-stopped
# SOCKS5 代理 / SOCKS5 proxy
curl --proxy socks5h://127.0.0.1:40000 https://www.cloudflare.com/cdn-cgi/trace
# 也可以当 HTTP 代理用(支持 HTTP CONNECT)
# Can also be used as an HTTP proxy (supports HTTP CONNECT)
curl --proxy http://127.0.0.1:40000 https://www.cloudflare.com/cdn-cgi/trace
docker logs -f warp
docker exec -it warp warp-cli --accept-tos status
Content type
Image
Digest
sha256:1f5512445…
Size
290.9 MB
Last updated
9 days ago
docker pull galtjay/warp