修改 docker 编译

This commit is contained in:
bjdgyc
2024-01-30 11:06:15 +08:00
parent 10a335dc3d
commit f9ff92d73d
6 changed files with 121 additions and 76 deletions

View File

@@ -36,6 +36,7 @@ COPY --from=builder_golang /server/anylink /app/
COPY docker/docker_entrypoint.sh /app/
COPY ./server/bridge-init.sh /app/
COPY ./server/conf /app/conf
COPY ./systemd /app/systemd
COPY ./README.md /app/README.md
COPY ./LICENSE /app/LICENSE
COPY ./home /app/home

View File

@@ -8,7 +8,7 @@ if [[ $CN == "yes" ]]; then
export GOPROXY=https://goproxy.cn
fi
apk add tzdata gcc musl-dev
apk add tzdata gcc musl-dev upx
uname -a
env
@@ -20,12 +20,13 @@ go mod tidy
echo "start build"
#-extldflags '-static'
ldflags="-s -w -extldflags \"-static\" -X main.appVer=$appVer -X main.commitId=$commitId -X main.buildDate=$(date -Iseconds)"
ldflags="-s -w -extldflags '-static' -X main.appVer=$appVer -X main.commitId=$commitId -X main.buildDate=$(date -Iseconds)"
go build -o anylink -trimpath -ldflags "$ldflags"
ls -l /server/
ls -lh /server/
# 压缩文件
upx -9 -k anylink
/server/anylink -v