Closed Cyber1000 closed 2 years ago
I found an easier solution than changing user of /var/lib/docker/volumes/gitserver_tmpdata/_data direct from outside the docker-container:
#!/bin/bash
if ! [[ $(ls -ld /tmpdata | awk '{print $3}') = ${USER} ]]; then chown -R ${USER}:git /tmpdata; fi
So more or less I'm adding a onetimejob which changes the dir from within the container. Maybe worth mentioning in docs, that you can use s6 for special tasks. A dedicated entry point for user initialisations at /etc/s6/gitea/run may be fine though
I think this proposal could be closed.
For docker image, it's not recommended to change the directory layout manually. If you need your own layout, you could build your own docker image.
And entrypoint doesn't know what directory is really needed when the docker container is starting. Even more, to be stable, an app shouldn't create too many non-existing directories unexpectedly, usually it's user's responsibility to prepare all parent directories.
[x]
):Description
gitea/docker/usr/bin/entrypoint does this:
for FOLDER in /data/gitea/conf /data/gitea/log /data/git /data/ssh; do mkdir -p ${FOLDER} done
So it creates the folders with root permissions (it changes user to git later on in docker/etc/s6/gitea/setup)my log-location in app.ini:
"Normal" configs are still in /data-Folder
/tmpdata/gitea (or /tmpdata/gitea/log) is not there when starting gitea (and won't be created in entrypoint), when running it tries to create the folder, at least it seems so (but obviously with git-user) and dies:
Problem: I have to manually chown tmpdata on my host, if tmpdata would be a normal mountpoint this wouldn't be a problem, but I have to do this on a named volume (and therefore /var/lib/docker/volumes/gitserver_tmpdata/_data), which is quite unusual
Proposal: parse app.ini in entrypoint and create all necessary folders in docker entrypoint (even if they are different from /data/gitea). May be done toghether with #4425
My user within container is (as stated in the docker-compose.yml examples) git, and I dared to change it (to root), cause I dind't know if any side effects could occur: