mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-21 07:49:38 +08:00
update Dockerfile & script
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -9,17 +9,25 @@ RUN apk add --update --no-cache \
|
|||||||
&& go get -u github.com/gobuffalo/packr/packr \
|
&& go get -u github.com/gobuffalo/packr/packr \
|
||||||
&& packr \
|
&& packr \
|
||||||
&& make build \
|
&& make build \
|
||||||
&& mv ./bin/tun2socks /tun2socks
|
&& /tun2socks-src/bin/tun2socks -version
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
COPY ./tun2socks.sh /
|
COPY ./tun2socks.sh /
|
||||||
COPY --from=builder /tun2socks /usr/local/bin
|
COPY --from=builder /tun2socks-src/bin/tun2socks /tun2socks
|
||||||
|
|
||||||
RUN apk add --update --no-cache iproute2 \
|
RUN apk add --update --no-cache iproute2 \
|
||||||
&& chmod +x /tun2socks.sh
|
&& chmod +x /tun2socks.sh
|
||||||
|
|
||||||
ENV TUN tun0
|
ENV TUN tun0
|
||||||
ENV ETH eth0
|
ENV ETH eth0
|
||||||
|
ENV ETHGW=
|
||||||
|
ENV TUNGW=
|
||||||
|
ENV PROXY=
|
||||||
|
ENV MONITOR=
|
||||||
|
ENV LOGLEVEL=
|
||||||
|
ENV EXCLUDED=
|
||||||
|
ENV BACKENDDNS=
|
||||||
|
ENV HOSTS=
|
||||||
|
|
||||||
ENTRYPOINT ["/tun2socks.sh"]
|
ENTRYPOINT ["/tun2socks.sh"]
|
||||||
|
@@ -27,9 +27,9 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# DNS settings
|
# DNS settings
|
||||||
echo "nameserver $TUNGW" > /etc/resolv.conf
|
echo "nameserver $TUNGW" >> /etc/resolv.conf
|
||||||
|
|
||||||
exec tun2socks -loglevel $LOGLEVEL \
|
exec /tun2socks -loglevel $LOGLEVEL \
|
||||||
-tunName $TUN -proxyServer $PROXY \
|
-tunName $TUN -proxyServer $PROXY \
|
||||||
-monitor -monitorAddr $MONITOR \
|
-monitor -monitorAddr $MONITOR \
|
||||||
-fakeDNS -hosts $HOSTS \
|
-fakeDNS -hosts $HOSTS \
|
||||||
|
Reference in New Issue
Block a user