Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix go build vcs errors #385

Merged
merged 1 commit into from
Feb 18, 2023
Merged

Fix go build vcs errors #385

merged 1 commit into from
Feb 18, 2023

Conversation

amacneil
Copy link
Owner

@amacneil amacneil commented Feb 18, 2023

Fix CI errors related to go embedding vcs info in binaries. It seems reasonable to include this info.

Error was:

$ docker-compose run --rm --no-deps dev make build ls
rm -rf dist
go build -o dist/dbmate -tags netgo,osusergo,sqlite_omit_load_extension,sqlite_json  -ldflags '-s -extldflags "-static"' .
error obtaining VCS status: exit status 128
	Use -buildvcs=false to disable VCS stamping.
make: *** [Makefile:34: build] Error 1

And underlying error was:

$ docker-compose run --rm --no-deps dev git status
fatal: detected dubious ownership in repository at '/src'
To add an exception for this directory, call:

	git config --global --add safe.directory /src

Solution:

  • Don't exclude .git directory from docker so it's available in the docker build
  • Mark /src as safe for git in dockerfile

Closes #384

@amacneil amacneil changed the title Remove .dockerignore Fix go build vcs errors Feb 18, 2023
@amacneil amacneil merged commit 646a1aa into main Feb 18, 2023
@amacneil amacneil deleted the adrian/noignoregit branch February 18, 2023 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant