mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
fix: let dev docker compose service runs as root (#21579)
This commit is contained in:
parent
04c9531624
commit
a10a946d1a
3 changed files with 7 additions and 9 deletions
8
Makefile
8
Makefile
|
|
@ -70,11 +70,9 @@ VOLUME_DIRS = \
|
|||
|
||||
# Helper function to chown, on error suggest remediation and exit
|
||||
define safe_chown
|
||||
if chown $(2) $(or $(UID),1000):$(or $(GID),1000) "$(1)" 2>/dev/null; then \
|
||||
true; \
|
||||
else \
|
||||
STATUS=$$?; echo "Exit code: $$STATUS $(1)"; \
|
||||
echo "$$STATUS $(1)"; \
|
||||
CURRENT_OWNER=$$(stat -c '%u:%g' "$(1)" 2>/dev/null || echo "none"); \
|
||||
DESIRED_OWNER="$(or $(UID),0):$(or $(GID),0)"; \
|
||||
if [ "$$CURRENT_OWNER" != "$$DESIRED_OWNER" ] && ! chown -v $(2) $$DESIRED_OWNER "$(1)" 2>/dev/null; then \
|
||||
echo "Permission denied when changing owner of volumes and upload location. Try running 'sudo make prepare-volumes' first."; \
|
||||
exit 1; \
|
||||
fi;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue