Skip to content

Commit

Permalink
Pass .git folder to Docker context (#1432)
Browse files Browse the repository at this point in the history
The problem this commit fix was that the `seid` binary built via Docker didn't contain the correct version when doing `seid version` because `.dockerignore` was specifying that `.git` should not be copied to the Docker context.

However, without copying it, the version cannot be computed anymore since the Makefile is defining version to be `VERSION := $(shell echo $(shell git describe --tags))` and of course if the `.git` is not copied, then this command cannot work.

Removing the `.git` from `.dockerignore` fixes the problem, it brings context transfer from `~78 MB` to `~295 MB` which added `1.1s` to a Docker build (0.4s vs 1.5s) on a Mac M1 Max.
  • Loading branch information
maoueh authored Mar 13, 2024
1 parent 5a300e7 commit 3755080
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
build/
.git/
# The .git folder must be transferred to Docker context since the Makefile
# uses git commands to get the current commit hash and tag for versioning.
# .git/

0 comments on commit 3755080

Please sign in to comment.