Files
2026-07-23 15:59:00 +08:00

36 lines
945 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 戎行专用OpenVPN 客户端 + microsocks SOCKS5走系统路由/tun0
FROM alpine:3.19 AS socks-builder
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk add --no-cache build-base
WORKDIR /src
COPY third_party/microsocks/ ./
RUN make && strip microsocks
FROM alpine:3.19
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk add --no-cache \
openvpn \
bash \
iproute2 \
curl
COPY --from=socks-builder /src/microsocks /usr/local/bin/microsocks
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh /usr/local/bin/microsocks
ENV VPN_DIR=/vpn \
SOCKS_HOST=0.0.0.0 \
SOCKS_PORT=1080 \
RONGXING_HOST=192.168.3.43
VOLUME ["/vpn"]
EXPOSE 1080
HEALTHCHECK --interval=30s --timeout=5s --start-period=45s --retries=5 \
CMD ip link show tun0 >/dev/null 2>&1 || exit 1
ENTRYPOINT ["/entrypoint.sh"]