mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 07:37:52 +08:00
修改 docker 编译
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user