From 0ff1923d3e48da1ec3444471f841ac91602d6a10 Mon Sep 17 00:00:00 2001 From: casjay Date: Fri, 5 Jun 2026 17:40:04 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20git=20fatal=20error=20read?= =?UTF-8?q?ing=20/root/.git=20at=20gitea=20startup=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docker's WORKDIR is /root and the git user has no read permission on that directory. When gitea starts via gosu git, git inherits /root as the working directory, calls getcwd(), constructs /root/.git, and fails with "fatal: error reading '/root/.git'" — crashing gitea. Setting WORK_DIR=/data/gitea causes the init functions library to cd to /data/gitea before launching the service, so git never sees /root. - rootfs/usr/local/etc/docker/init.d/08-gitea.sh: set WORK_DIR=/data/gitea rootfs/usr/local/etc/docker/init.d/08-gitea.sh --- rootfs/usr/local/etc/docker/init.d/08-gitea.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/usr/local/etc/docker/init.d/08-gitea.sh b/rootfs/usr/local/etc/docker/init.d/08-gitea.sh index 57a83b8..883af7b 100755 --- a/rootfs/usr/local/etc/docker/init.d/08-gitea.sh +++ b/rootfs/usr/local/etc/docker/init.d/08-gitea.sh @@ -145,7 +145,7 @@ RUN_DIR="/run/gitea" LOG_DIR="/data/logs/gitea" # - - - - - - - - - - - - - - - - - - - - - - - - - # Set the working dir -WORK_DIR="" +WORK_DIR="/data/gitea" # - - - - - - - - - - - - - - - - - - - - - - - - - # port which service is listening on SERVICE_PORT="80"