Skip to content

Commit

Permalink
docker: check "/data" mount ownership before forcing it (#6553)
Browse files Browse the repository at this point in the history
Co-authored-by: bl <bl@moch.dk>
  • Loading branch information
2 people authored and unknwon committed Mar 13, 2022
1 parent e309bc8 commit 5aca56d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docker/start.sh
Expand Up @@ -31,8 +31,12 @@ cleanup() {
}

create_volume_subfolder() {
# Modify the owner of /data dir, make $USER(git) user have permission to create sub-dir in /data.
chown -R "$USER:$USER" /data
# only change ownership if needed, if using an nfs mount this could be expensive
if [ "$USER:$USER" != "$(stat /data -c '%U:%G')" ]
then
# Modify the owner of /data dir, make $USER(git) user have permission to create sub-dir in /data.
chown -R "$USER:$USER" /data
fi

# Create VOLUME subfolder
for f in /data/gogs/data /data/gogs/conf /data/gogs/log /data/git /data/ssh; do
Expand Down

0 comments on commit 5aca56d

Please sign in to comment.