From 2355cc3fd94f455c0b44e3b144ae201a11969076 Mon Sep 17 00:00:00 2001 From: Ersi Ni Date: Mon, 22 Jun 2026 16:45:13 +0100 Subject: [PATCH] fix: keep .git in build context so server Dockerfile can stamp commit hash The 1.0.0 release added .dockerignore which excluded .git. server/Dockerfile uses --mount=type=bind,source=.git to stamp the latest server commit into the image (added in #1517), and BuildKit honors .dockerignore for bind mount sources, so fresh builds fail with: failed to compute cache key: ... "/.git": not found The bind mount approach never bakes .git into a layer, so keeping it in the build context is safe. Fixes #1702 --- .dockerignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index a948491df..bbd6156e8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,7 +2,9 @@ # Docker reads it from the context root. # Source control -.git +# Note: .git is intentionally NOT ignored — server/Dockerfile bind-mounts it +# (--mount=type=bind,source=.git) to stamp the server commit into the image +# without baking .git into any layer. Excluding it here breaks the build. .gitignore .gitattributes