mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-10 09:02:42 +08:00
feat: 静态编译不依赖 glibc
This commit is contained in:
parent
c82e20efd7
commit
2b7f68f3fe
2 changed files with 5 additions and 8 deletions
|
@ -16,9 +16,6 @@ builds:
|
||||||
- -trimpath
|
- -trimpath
|
||||||
ldflags:
|
ldflags:
|
||||||
- -w -s
|
- -w -s
|
||||||
- --extldflags "-static -fpic"
|
|
||||||
tags:
|
|
||||||
- osusergo
|
|
||||||
goos:
|
goos:
|
||||||
- linux
|
- linux
|
||||||
goarm:
|
goarm:
|
||||||
|
|
10
Makefile
10
Makefile
|
@ -23,16 +23,16 @@ build_frontend:
|
||||||
|
|
||||||
build_backend_on_linux:
|
build_backend_on_linux:
|
||||||
cd $(SERVER_PATH) \
|
cd $(SERVER_PATH) \
|
||||||
&& GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags '-s -w --extldflags "-static -fpic"' -tags 'osusergo,netgo' -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
|
&& GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags '-s -w' -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
|
||||||
|
|
||||||
build_backend_on_darwin:
|
build_backend_on_darwin:
|
||||||
cd $(SERVER_PATH) \
|
cd $(SERVER_PATH) \
|
||||||
&& GOOS=linux GOARCH=amd64 $(GOBUILD) -trimpath -ldflags '-s -w --extldflags "-static -fpic"' -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
|
&& GOOS=linux GOARCH=amd64 $(GOBUILD) -trimpath -ldflags '-s -w' -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
|
||||||
|
|
||||||
build_backend_on_archlinux:
|
build_backend_on_archlinux:
|
||||||
cd $(SERVER_PATH) \
|
cd $(SERVER_PATH) \
|
||||||
&& GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags '-s -w --extldflags "-fpic"' -tags osusergo -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
|
&& GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags '-s -w' -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
|
||||||
|
|
||||||
build_all: build_frontend build_backend_on_linux
|
build_all: build_frontend build_backend_on_linux
|
||||||
|
|
||||||
build_on_local: clean_assets build_frontend build_backend_on_darwin upx_bin
|
build_on_local: clean_assets build_frontend build_backend_on_darwin upx_bin
|
||||||
|
|
Loading…
Reference in a new issue