From 774325ed6396fd2b7e8c84b0586ed8c6cc9dd429 Mon Sep 17 00:00:00 2001 From: dnomd343 Date: Fri, 19 Aug 2022 00:18:15 +0800 Subject: [PATCH] build: add v2fly-core and sagernet-core --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index 08ce87f..ee4dc61 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,10 +10,20 @@ RUN make -C ./src/ && mkdir -p /upx/bin/ && mv ./src/upx.out /upx/bin/upx && \ FROM golang:1.18-alpine3.16 AS proxy ENV XRAY_VERSION="1.5.9" +ENV V2FLY_VERSION="4.45.2" +ENV SAGER_VERSION="5.0.16" RUN wget https://github.com/XTLS/Xray-core/archive/refs/tags/v${XRAY_VERSION}.tar.gz && tar xf v${XRAY_VERSION}.tar.gz +RUN wget https://github.com/v2fly/v2ray-core/archive/refs/tags/v${V2FLY_VERSION}.tar.gz && tar xf v${V2FLY_VERSION}.tar.gz +RUN wget https://github.com/SagerNet/v2ray-core/archive/refs/tags/v${SAGER_VERSION}.tar.gz && tar xf v${SAGER_VERSION}.tar.gz WORKDIR ./Xray-core-${XRAY_VERSION}/ RUN go mod download -x RUN env CGO_ENABLED=0 go build -v -o xray -trimpath -ldflags "-s -w" ./main/ && mv ./xray /tmp/ +WORKDIR ../v2ray-core-${V2FLY_VERSION}/ +RUN go mod download -x +RUN env CGO_ENABLED=0 go build -v -o v2ray -trimpath -ldflags "-s -w" ./main/ && mv ./v2ray /tmp/ +WORKDIR ../v2ray-core-${SAGER_VERSION}/ +RUN go mod download -x +RUN env CGO_ENABLED=0 go build -v -o sagray -trimpath -ldflags "-s -w" ./main/ && mv ./sagray /tmp/ COPY --from=upx /upx/ /usr/ RUN ls /tmp/*ray | xargs -P0 -n1 upx -9