From dff6e2fd1ee20c6fdfd1a04f191374643c2dd120 Mon Sep 17 00:00:00 2001 From: apple Date: Sat, 14 Nov 2026 14:57:08 +0800 Subject: [PATCH] fix: make the dokku data directory writable on source installs debian/postinst creates /var/lib/dokku/data and gives it to the dokku user, but make install never did. When data ends up root-owned, every deploy fails because the build hook creates data/builds/ as the dokku user. Mirror the postinst setup and repair root-owned entries below data as well. --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 60dfe0e14..0f21774fa 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ else BUILD_STACK_TARGETS = build-in-docker endif -.PHONY: all apt-update install version copyfiles copyplugin man-db plugins dependencies docker-image-labeler lambda-builder netrc sshcommand procfile-util plugn docker aufs stack count vagrant-acl-add vagrant-dokku go-build wget +.PHONY: all apt-update install version copyfiles copyplugin dokku-lib-dirs man-db plugins dependencies docker-image-labeler lambda-builder netrc sshcommand procfile-util plugn docker aufs stack count vagrant-acl-add vagrant-dokku go-build wget include docs.mk include tests.mk @@ -42,7 +42,14 @@ include arch.mk all: # Type "make install" to install. -install: dependencies version copyfiles plugin-dependencies plugins +install: dependencies version copyfiles dokku-lib-dirs plugin-dependencies plugins + +# mirrors setup-storage from debian/postinst so source installs leave the +# data directory writable by the dokku user, which owns every deploy hook +dokku-lib-dirs: + mkdir -p ${DOKKU_LIB_ROOT}/data ${DOKKU_LIB_ROOT}/data/storage + chown dokku:dokku ${DOKKU_LIB_ROOT}/data + find ${DOKKU_LIB_ROOT}/data -user root -exec chown dokku:dokku {} + packer: