From 6f256958d1a5c1778d5464acf3102f073afc3c6b Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Thu, 19 Oct 2023 12:44:54 +0200 Subject: [PATCH] fix(tools/docker): set esp-idf repo as safe directory In our docker docs[1] we recommend to start docker as a non-root user. This has a side effect, because the esp-idf repo in docker image is owned by root. Git by default refuses even to parse a config file if the repo is owned by other than current user. As a result the version detection in cmake fails[2] and the app version is set to "HEAD-HASH-NOTFOUND". This adds esp-idf repo to the system git config as a safe one. [1] https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/ tools/idf-docker-image.html#building-a-project-with-cmake [2] https://github.com/espressif/esp-idf/issues/12389#issuecomment-1764268773 Closes https://github.com/espressif/esp-idf/issues/12389 Signed-off-by: Frantisek Hrbata --- tools/docker/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index f190156a05..cc27e9c0e0 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -64,6 +64,7 @@ RUN echo IDF_CHECKOUT_REF=$IDF_CHECKOUT_REF IDF_CLONE_BRANCH_OR_TAG=$IDF_CLONE_B ${IDF_CLONE_SHALLOW:+--depth=1 --shallow-submodules} \ ${IDF_CLONE_BRANCH_OR_TAG:+-b $IDF_CLONE_BRANCH_OR_TAG} \ $IDF_CLONE_URL $IDF_PATH && \ + git config --system --add safe.directory $IDF_PATH && \ if [ -n "$IDF_CHECKOUT_REF" ]; then \ cd $IDF_PATH && \ if [ -n "$IDF_CLONE_SHALLOW" ]; then \