aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfebrezo <contacto@felixbrezo.com>2023-12-24 19:28:49 +0100
committerFintasticMan <finlay.neon.kid@gmail.com>2024-11-17 15:22:22 +0100
commit6c7eb6630ed3565561957a02af36896cc4653cb0 (patch)
treef95e5ce26e63529c6a10df9c338bc0fbb11c068c
parent4dd0d60eeb3aa2aaa6759bbad2210ea5c3a47c2b (diff)
Fix git hash calculation with Docker build
Fix error when compiling the Pinetime using the Docker image. If done with Docker, the container does not trust the /sources folder, leading to a blank response of the command that grabs the git commit `git rev-parse --short HEAD`. ``` fatal: detected dubious ownership in repository at '/sources' To add an exception for this directory, call: git config --global --add safe.directory /sources PROJECT_GIT_COMMIT_HASH_SUCCESS? 128 BUILD CONFIGURATION ------------------- * Mode : Release * Version : 1.3.0 * Toolchain : /opt/gcc-arm-none-eabi-10.3-2021.10 * GitRef(S) : * NRF52 SDK : /opt/nRF5_SDK_15.3.0_59ac345 * Target device : PINETIME * Build DFU (using adafruit-nrfutil) : Enabled * Build resources : Enabled ``` If the `git config --global --add safe.directory /sources` is added to the Dockerfile, the problem is solved and the hash is added correctly.
-rw-r--r--docker/Dockerfile5
1 files changed, 4 insertions, 1 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index bb5d5f65..e6d92aae 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -64,6 +64,9 @@ RUN bash -c "source /opt/build.sh; GetMcuBoot;"
# Add the infinitime user for connecting devcontainer
RUN adduser infinitime
-
+
+# Configure Git to accept the /sources directory as safe
+RUN git config --global --add safe.directory /sources
+
ENV SOURCES_DIR /sources
CMD ["/opt/build.sh"]