From b24ef88a80eb7e6ff15666c5d2e56e78de8a1e71 Mon Sep 17 00:00:00 2001 From: Meow <197331664+Meo597@users.noreply.github.com> Date: Thu, 20 Nov 2025 21:20:53 +0800 Subject: [PATCH] Docker: Use more aggressive inlining for higher efficiency (#5242) Syncs https://github.com/XTLS/Xray-core/pull/5026 --- .github/docker/Dockerfile | 2 +- .github/docker/Dockerfile.usa | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/docker/Dockerfile b/.github/docker/Dockerfile index 0b6f2932..867e671a 100644 --- a/.github/docker/Dockerfile +++ b/.github/docker/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /src COPY . . ARG TARGETOS ARG TARGETARCH -RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main +RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags "-s -w -buildid=" ./main # Download geodat into a staging directory ADD https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/geoip.dat /tmp/geodat/geoip.dat diff --git a/.github/docker/Dockerfile.usa b/.github/docker/Dockerfile.usa index b307bc4b..80cc523a 100644 --- a/.github/docker/Dockerfile.usa +++ b/.github/docker/Dockerfile.usa @@ -6,7 +6,7 @@ WORKDIR /src COPY . . ARG TARGETOS ARG TARGETARCH -RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main +RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags "-s -w -buildid=" ./main # Download geodat into a staging directory ADD https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/geoip.dat /tmp/geodat/geoip.dat