mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-08 19:06:06 +03:00
[PR #5969] [MERGED] Git 2.35+ may refuse to operate on bind-mounted repos with differing ownership ("dubious ownership"), Mark /app as safe within the container. #6609
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/BookStackApp/BookStack/pull/5969
Author: @shaoliang123456
Created: 12/30/2025
Status: ✅ Merged
Merged: 1/3/2026
Merged by: @ssddanbrown
Base:
development← Head:fix/git-safe-directory-in-docker📝 Commits (2)
5c4fc3dfix: Docker: Add018de5dfix: Configure safe directory for git in dockerfile📊 Changes
1 file changed (+3 additions, -0 deletions)
View changed files
📝
dev/docker/Dockerfile(+3 -0)📄 Description
Local Environment:
WSL2 + Windows 11 + Docker Desktop + Git 2.43.0
After starting the application with docker compose up, the logs show the following warning:
The repository at "/app" does not have the correct ownership and git refuses to use it:
fatal: detected dubious ownership in repository at '/app'
To add an exception for this directory, call:
git config --global --add safe.directory /app
This occurs because Git 2.35.2+ enforces ownership checks on repositories, and the bind-mounted /app directory in the container has a different UID than the container’s runtime user. While this doesn’t break the web application itself, it prevents developers from using Git commands inside the container (e.g., for debugging or version detection), and clutters the logs.
This PR automatically adds /app to Git’s safe.directory list in the app container’s entrypoint, resolving the issue without affecting functionality.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.