From d2b1a95f46fd939de91456c4e60ab4e1cf97b408 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sat, 4 Mar 2023 00:49:13 +0800 Subject: [PATCH 1/4] build: use xray dev version for REALITY feature --- Dockerfile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index a95158d..30aebf0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,16 @@ WORKDIR ./build/release/ RUN strip upx && mv upx /tmp/ FROM ${GOLANG} AS xray -ENV XRAY="1.7.5" -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/ +#ENV XRAY="1.7.5" +#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/ + +# TODO: use xray dev version just for now +RUN apk add git +RUN git clone https://github.com/XTLS/Xray-core.git +WORKDIR ./Xray-core/main/ +RUN git checkout 4c8ee0af50bbabd29e6766f0d9509add6fc0b2e7 + RUN go get -d RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv main /tmp/xray COPY --from=upx /tmp/upx /usr/bin/ From 918480eba1466f325367060fc3753c8b3b5b6b3a Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Thu, 9 Mar 2023 12:51:45 +0800 Subject: [PATCH 2/4] feat: get version info from git describe --- Dockerfile | 7 ++++--- cmd/xproxy.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 30aebf0..a3819d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,16 +21,17 @@ RUN git clone https://github.com/XTLS/Xray-core.git WORKDIR ./Xray-core/main/ RUN git checkout 4c8ee0af50bbabd29e6766f0d9509add6fc0b2e7 -RUN go get -d +RUN go get RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv main /tmp/xray COPY --from=upx /tmp/upx /usr/bin/ RUN upx -9 /tmp/xray FROM ${GOLANG} AS xproxy +RUN apk add git COPY ./ /XProxy/ WORKDIR /XProxy/cmd/ -RUN go get -d -RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv cmd /tmp/xproxy +RUN go get +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/ RUN upx -9 /tmp/xproxy diff --git a/cmd/xproxy.go b/cmd/xproxy.go index 40edffb..6d08b08 100644 --- a/cmd/xproxy.go +++ b/cmd/xproxy.go @@ -15,7 +15,7 @@ import ( "strconv" ) -var version = "1.0.2" +var version = "dev" var v4RouteTable = 104 var v6RouteTable = 106 var v4TProxyPort = 7288 From da9b5fe2be244c2029af1228aca670455e2b4951 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Thu, 9 Mar 2023 13:32:59 +0800 Subject: [PATCH 3/4] build: xray pre-release XTLS/Xray-core@79c0b0a0f2c82a67e353be41c2a85dcb9cbbfe59 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a3819d1..249ec7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ FROM ${GOLANG} AS xray RUN apk add git RUN git clone https://github.com/XTLS/Xray-core.git WORKDIR ./Xray-core/main/ -RUN git checkout 4c8ee0af50bbabd29e6766f0d9509add6fc0b2e7 +RUN git checkout 79c0b0a0f2c82a67e353be41c2a85dcb9cbbfe59 RUN go get RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv main /tmp/xray From 177aa8ded820ee2c1eda3740fa0de9b4b0ca0030 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Fri, 10 Mar 2023 10:20:18 +0800 Subject: [PATCH 4/4] build: xray version `1.8.0` --- Dockerfile | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 249ec7d..09bc62a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,16 +11,9 @@ WORKDIR ./build/release/ RUN strip upx && mv upx /tmp/ FROM ${GOLANG} AS xray -#ENV XRAY="1.7.5" -#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/ - -# TODO: use xray dev version just for now -RUN apk add git -RUN git clone https://github.com/XTLS/Xray-core.git -WORKDIR ./Xray-core/main/ -RUN git checkout 79c0b0a0f2c82a67e353be41c2a85dcb9cbbfe59 - +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 +WORKDIR ./Xray-core-${XRAY}/main/ RUN go get RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv main /tmp/xray COPY --from=upx /tmp/upx /usr/bin/