Browse Source

Merge branch 'dev'

v1.x.x
Dnomd343 2 years ago
parent
commit
3c277a7393
  1. 9
      Dockerfile
  2. 2
      cmd/xproxy.go

9
Dockerfile

@ -11,19 +11,20 @@ WORKDIR ./build/release/
RUN strip upx && mv upx /tmp/ RUN strip upx && mv upx /tmp/
FROM ${GOLANG} AS xray FROM ${GOLANG} AS xray
ENV XRAY="1.7.5" ENV XRAY="1.8.0"
RUN wget https://github.com/XTLS/Xray-core/archive/refs/tags/v${XRAY}.tar.gz && tar xf v${XRAY}.tar.gz RUN wget https://github.com/XTLS/Xray-core/archive/refs/tags/v${XRAY}.tar.gz && tar xf v${XRAY}.tar.gz
WORKDIR ./Xray-core-${XRAY}/main/ WORKDIR ./Xray-core-${XRAY}/main/
RUN go get -d RUN go get
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv main /tmp/xray RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv main /tmp/xray
COPY --from=upx /tmp/upx /usr/bin/ COPY --from=upx /tmp/upx /usr/bin/
RUN upx -9 /tmp/xray RUN upx -9 /tmp/xray
FROM ${GOLANG} AS xproxy FROM ${GOLANG} AS xproxy
RUN apk add git
COPY ./ /XProxy/ COPY ./ /XProxy/
WORKDIR /XProxy/cmd/ WORKDIR /XProxy/cmd/
RUN go get -d RUN go get
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv cmd /tmp/xproxy RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.version=$(git describe --tag) -s -w" && mv cmd /tmp/xproxy
COPY --from=upx /tmp/upx /usr/bin/ COPY --from=upx /tmp/upx /usr/bin/
RUN upx -9 /tmp/xproxy RUN upx -9 /tmp/xproxy

2
cmd/xproxy.go

@ -15,7 +15,7 @@ import (
"strconv" "strconv"
) )
var version = "1.0.2" var version = "dev"
var v4RouteTable = 104 var v4RouteTable = 104
var v6RouteTable = 106 var v6RouteTable = 106
var v4TProxyPort = 7288 var v4TProxyPort = 7288

Loading…
Cancel
Save