From b93c320987a936db6e5ca50c547022de9ab9a0f1 Mon Sep 17 00:00:00 2001 From: "henry.chen" Date: Wed, 28 Sep 2022 18:20:38 +0800 Subject: [PATCH] fix: cgo and sqlite build in alpine image closed #28 --- scripts/run_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_build.sh b/scripts/run_build.sh index a9fa389..f39146b 100755 --- a/scripts/run_build.sh +++ b/scripts/run_build.sh @@ -20,7 +20,7 @@ mkdir -p ./bin # build demo app for file in pkg/core/*; do app="$(basename $file)"; - CGO_ENABLED=0 go build -tags prod -o bin/backend "./cmd/$app" + go build -tags prod -ldflags '-extldflags "-static"' -o bin/backend "./cmd/$app" # docker image docker buildx build --platform "$_platform" \ -f "build/package/$app.Dockerfile" \