This commit is contained in:
xjasonlyu
2020-11-05 18:41:15 +08:00
parent 6f89409a03
commit e1e96c8cfb
50 changed files with 3963 additions and 0 deletions
+32
View File
@@ -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"]
+35
View File
@@ -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