Skip to content

Commit 3c8c2b7

Browse files
committed
Create ./volumes at cloning
Menu usually won't explicitly create the ./volumes -folder, hence Docker will create it as owned by root. This will later cause problems for build hooks trying to prepare directories into a now root-owned folder. E.g. adding nextcloud later will fail with: Error running PreBuildHook on 'nextcloud' [Errno 13] Permission denied: './volumes/nextcloud' Creating volumes as part of the initial git-clone will ensure it's owned by the correct user. For existing users, also add command to fix its owner when the menu is started.
1 parent 732889a commit 3c8c2b7

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ignore data folders for containers
22
/services/
3-
/volumes/
3+
/volumes/*
44
/backups/
55
/.tmp/*
66
__pycache__

menu.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,8 @@ function do_project_checks() {
339339
[ -f .project_outofdate ] && rm .project_outofdate
340340
echo "Project is up to date" >&2
341341
fi
342+
# volumes shouldn't be owned by root, change it to the current user
343+
[[ $(id -u) != "0" ]] && sudo chown $(id -u):$(id -g) volumes
342344
}
343345

344346
function do_env_checks() {

volumes/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)