mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2026-04-23 00:07:30 +08:00
v2
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
FROM arm64v8/golang:alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
|
||||
RUN apk add --no-cache make git \
|
||||
&& go mod download \
|
||||
&& make docker \
|
||||
&& /app/bin/tun2socks-docker -v
|
||||
|
||||
FROM arm64v8/alpine:latest
|
||||
|
||||
COPY ./scripts/entrypoint.sh /entrypoint.sh
|
||||
COPY --from=builder /app/bin/tun2socks-docker /usr/bin/tun2socks
|
||||
|
||||
RUN apk add --update --no-cache iptables iproute2 \
|
||||
&& chmod +x /entrypoint.sh
|
||||
|
||||
ENV TUN tun0
|
||||
ENV ETH eth0
|
||||
ENV TUN_ADDR=
|
||||
ENV TUN_MASK=
|
||||
ENV LOGLEVEL=
|
||||
ENV EXCLUDED=
|
||||
ENV EXTRACMD=
|
||||
|
||||
ENV API=
|
||||
ENV DNS=
|
||||
ENV HOSTS=
|
||||
ENV PROXY=
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -0,0 +1,35 @@
|
||||
version: '2.4'
|
||||
|
||||
services:
|
||||
tun2socks:
|
||||
image: xjasonlyu/tun2socks:arm64-dev
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
devices:
|
||||
- '/dev/net/tun:/dev/net/tun'
|
||||
environment:
|
||||
- GODEBUG=madvdontneed=1
|
||||
- PROXY=
|
||||
- LOGLEVEL=warning
|
||||
- API=:8080
|
||||
- DNS=
|
||||
- HOSTS=
|
||||
- EXCLUDED=
|
||||
- EXTRACMD=
|
||||
networks:
|
||||
switch:
|
||||
ipv4_address: 172.20.1.20
|
||||
restart: always
|
||||
container_name: tun2socks
|
||||
|
||||
networks:
|
||||
switch:
|
||||
name: switch
|
||||
ipam:
|
||||
driver: default
|
||||
config:
|
||||
- subnet: '172.20.1.0/25'
|
||||
gateway: 172.20.1.1
|
||||
driver: macvlan
|
||||
driver_opts:
|
||||
parent: eth0
|
||||
Reference in New Issue
Block a user