You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
722 B

4 years ago
FROM golang:alpine AS builder
WORKDIR /tun2socks-src
COPY . /tun2socks-src
4 years ago
RUN apk add --no-cache make git \
&& go mod download \
&& make tun2socks \
&& mv ./bin/tun2socks /tun2socks
4 years ago
FROM alpine:latest
4 years ago
LABEL org.opencontainers.image.source="https://github.com/xjasonlyu/tun2socks"
4 years ago
4 years ago
COPY docker/entrypoint.sh /entrypoint.sh
COPY --from=builder /tun2socks /usr/bin/tun2socks
RUN apk add --update --no-cache iptables iproute2 \
&& chmod +x /entrypoint.sh
ENV TUN=tun0
ENV ETH=eth0
ENV TUN_ADDR=198.18.0.1
ENV TUN_MASK=255.254.0.0
ENV LOGLEVEL=INFO
ENV PROXY=direct://
ENV MTU=9000
4 years ago
ENV STATS=
ENV TOKEN=
ENV EXTRA_COMMANDS=
ENV TUN_INCLUDED_ROUTES=
ENV TUN_EXCLUDED_ROUTES=
4 years ago
ENTRYPOINT ["/entrypoint.sh"]