fix: disable UPX compression in Dockerfile to resolve #863 startup regression

master
ginuerzh 2026-06-03 00:13:42 +08:00
parent 41e1878ebc
commit 78a0a8c734
1 changed files with 5 additions and 4 deletions

View File

@ -2,8 +2,10 @@ FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.6.1 AS xx
FROM --platform=$BUILDPLATFORM golang:1.26-alpine3.23 AS builder FROM --platform=$BUILDPLATFORM golang:1.26-alpine3.23 AS builder
# add upx for binary compression # UPX compression disabled by default (see #863): upx --best adds ~3s startup
RUN apk add --no-cache upx || echo "upx not found" # time on low-spec systems (linux/arm). Builds can opt in by uncommenting the
# upx install line and adding upx --best to the build command below.
# RUN apk add --no-cache upx || echo "upx not found"
COPY --from=xx / / COPY --from=xx / /
@ -21,8 +23,7 @@ COPY . .
RUN cd cmd/gost && \ RUN cd cmd/gost && \
xx-go build -ldflags "-s -w" && \ xx-go build -ldflags "-s -w" && \
xx-verify gost && \ xx-verify gost
{ upx --best gost || true; }
FROM alpine:3.23 FROM alpine:3.23