Permission denied when try to merge or update in webinterface on docker


i created my own docker image, based on alpine for gitea. I use gitea 1.7.2 currently. The docker-host is a current CentOS.
I have the issue, that it is not possible to update something in a repo and to do merges with the webinterface (i think they belong together). When i try to do that, i get the following messages:

Edit something in the webinterface and commit:
UpdateLocalCopyBranch [branch: master]: git clone master: mkdir data: permission denied (Message appera in web ui)

Try to merge something within the webinterface
[…routers/repo/pull.go:589 MergePullRequest()] [E] Merge: Failed to create dir data/tmp/local-repo/merge-302991419.git: mkdir data: permission denied (Message appear in logfile)

The environment
In the docker image i created a user “appuser” with UID and GID 140000. The gitea binaries are stored in /home/appuser/app, the configuration files are stored in /home/appuser/data. Of course, the appuser has access to both directories. I have a startscript (shell) as entrypoint defined. In this startscript i set all needed variables:

  • export USER=$(whoami)
  • export USERNAME=$(whoami)
  • export GITEA_CUSTOM=/home/appuser/data/custom
  • export GITEA_WORK_DIR=/home/appuser/data

I tried to change the values for LOCAL_COPY_PATH to the fixed path /home/appuser/data/tmp/local-repo, but that changes just the error message in the logfile to

  • Completed POST /INT-MSG-Development-Workplace/development-workplace-openjdk/pulls/1/merge 404 Not Found in 21.478045ms*, but i get an Serverrror 500 as before.

Any idea what to change?

Thanks in advance


You should confirm that your user(git) on docker have enough permission to the mapping volumes.


thanks for your answer. As described in my question i have no user “git”. I created the user “appuser” and all binaries as well as the data directories are stored in the home directory of this user. But this user has all permissions (i can write to the directories when loging into the docker container with docker exec -it 8349234989 sh).