From 991688ea651e3728e9a2dc1363cc777732ff574d Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 11 May 2022 13:57:54 +0300 Subject: [PATCH] deployment/docker: pass `-buildvs=false` to `go build` for production builds This should resolve the `error obtaining VCS status: exit status 128` error when the environment contains incorrect version of git or has incorrect access rights to the directory with VictoriaMetrics source code. See the following links for additional info: - https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2508#issuecomment-1117126702 , - https://github.com/google/ko/issues/672 - https://github.com/golang/go/issues/49004 --- deployment/docker/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/docker/Makefile b/deployment/docker/Makefile index a4eceaa5c..00b395606 100644 --- a/deployment/docker/Makefile +++ b/deployment/docker/Makefile @@ -34,7 +34,7 @@ app-via-docker: package-builder --env GO111MODULE=on \ $(DOCKER_OPTS) \ $(BUILDER_IMAGE) \ - go build $(RACE) -mod=vendor -trimpath \ + go build $(RACE) -mod=vendor -trimpath -buildvcs=false \ -ldflags "-extldflags '-static' $(GO_BUILDINFO)" \ -tags 'netgo osusergo nethttpomithttp2 musl' \ -o bin/$(APP_NAME)$(APP_SUFFIX)-prod $(PKG_PREFIX)/app/$(APP_NAME) @@ -50,7 +50,7 @@ app-via-docker-windows: package-builder --env GO111MODULE=on \ $(DOCKER_OPTS) \ $(BUILDER_IMAGE) \ - go build $(RACE) -mod=vendor -trimpath \ + go build $(RACE) -mod=vendor -trimpath -buildvcs=false \ -ldflags "-s -w -extldflags '-static' $(GO_BUILDINFO)" \ -tags 'netgo osusergo nethttpomithttp2' \ -o bin/$(APP_NAME)-windows$(APP_SUFFIX)-prod.exe $(PKG_PREFIX)/app/$(APP_NAME)