From 609bd7f698e86dd9109630c3ac6ad4811b95d1b0 Mon Sep 17 00:00:00 2001
From: Filipe Silva <filipematossilva@gmail.com>
Date: Mon, 29 May 2023 10:33:29 +0100
Subject: [PATCH] fix: docker git needs config to trust source dir (#31066)

See https://www.kenmuse.com/blog/avoiding-dubious-ownership-in-dev-containers/ for details on how this happens with containers.

Fix #30865
---
 Dockerfile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Dockerfile b/Dockerfile
index 4179bc3317d..302f5d677f0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -14,6 +14,10 @@ RUN apt-get update && apt-get upgrade -y && apt-get install openjdk-11-jdk curl
     && ./linux-install-1.11.1.1262.sh
 
 COPY . .
+
+# version is pulled from git, but git doesn't trust the directory due to different owners
+RUN git config --global --add safe.directory /home/node
+
 RUN INTERACTIVE=false CI=true MB_EDITION=$MB_EDITION bin/build.sh
 
 # ###################
-- 
GitLab