From 3755080e042655e132840445851d64c618016be2 Mon Sep 17 00:00:00 2001 From: Matthieu Vachon Date: Wed, 13 Mar 2024 10:37:48 -0400 Subject: [PATCH] Pass `.git` folder to Docker context (#1432) 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. --- .dockerignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 0ccc60fd1..62b03e692 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,4 @@ build/ -.git/ \ No newline at end of file +# 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/ \ No newline at end of file