Skip to content

Commit

Permalink
deployment/docker: pass -buildvs=false to go build for production…
Browse files Browse the repository at this point in the history
… 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:
- #2508 (comment) ,
- ko-build/ko#672
- golang/go#49004
  • Loading branch information
valyala committed May 11, 2022
1 parent 68bfa05 commit 0a420c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deployment/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 0a420c4

Please sign in to comment.