Just use this line GOAMD64=v3 GOARM64=v8.0 go build -trimpath -ldflags -w -tags netgo,osusergo -buildmode=pie