From f14bf2089acfa75ba58b0d4159401e74bd26a528 Mon Sep 17 00:00:00 2001 From: arloor Date: Fri, 5 Jul 2024 15:57:55 +0800 Subject: [PATCH] chore: Update go.yaml workflow to use static linking for go_web_server --- .github/workflows/go.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 65e2b52..39cd136 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -23,7 +23,7 @@ jobs: - name: build-and-push run: | go mod tidy - CGO_ENABLED=0 go build -ldflags '-w -s' -a -installsuffix cgo -o go_web_server go_web_server/cmd/go_web_server + CGO_ENABLED=0 go build -ldflags '-w -s -extldflags "-static"' -a -installsuffix cgo -o go_web_server go_web_server/cmd/go_web_server podman build -f Dockerfile . -t docker.io/arloor/go_web_server:${{ github.sha }} -t docker.io/arloor/go_web_server:latest podman login docker.io -u arloor -p ${{ env.REGISTRY_PASSWORD }} podman push docker.io/arloor/go_web_server:${{ github.sha }}