Skip to content

Comments

Fix Docker tutorial build failing on fresh clone#1110

Open
jhf wants to merge 2 commits intohapostgres:mainfrom
veridit:fix-docker-tutorial-build
Open

Fix Docker tutorial build failing on fresh clone#1110
jhf wants to merge 2 commits intohapostgres:mainfrom
veridit:fix-docker-tutorial-build

Conversation

@jhf
Copy link

@jhf jhf commented Feb 4, 2026

Summary

  • Remove explicit COPY of git-version.h which doesn't exist in a fresh git clone (the Makefile generates it automatically)
  • Add check for .git directory before running git commands to avoid "fatal: not a git repository" warnings in Docker builds

Fixes: #1109

Test plan

  • docker compose build in docs/tutorial now succeeds on fresh clone
  • Version shows "unknown" in Docker builds (expected, no git repo)
  • Local builds with git still get correct version

🤖 Generated with Claude Code

jhf and others added 2 commits February 5, 2026 00:25
Remove explicit COPY of git-version.h which doesn't exist in a fresh
git clone. The file is generated by the Makefile when running make,
so the explicit COPY was redundant and caused the build to fail.

Fixes: hapostgres#1109

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Only run git commands to determine version when .git directory exists.
When building in Docker or from a tarball without .git, the version
is set to "unknown" instead of printing error messages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

docker tutorial fails to build

1 participant