From 44caf44ce61fbadf0c52121e8eb7b716aa6206a5 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 30 Sep 2021 01:47:04 -0400 Subject: [PATCH 1/2] fix: set the DOKKU_HOST_ROOT on docker container start Without this change, cache doesn't work when running in a docker container. --- docker/etc/my_init.d/10_dokku_init | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker/etc/my_init.d/10_dokku_init b/docker/etc/my_init.d/10_dokku_init index 7326c36ca..c0a1579f3 100755 --- a/docker/etc/my_init.d/10_dokku_init +++ b/docker/etc/my_init.d/10_dokku_init @@ -62,6 +62,12 @@ main() { echo "export DOCKER_BIN=/usr/local/bin/docker" >"/home/dokku/.dokkurc/DOCKER_BIN" fi + if [[ -n "$DOKKU_HOST_ROOT" ]]; then + touch /etc/default/dokku + echo "export DOKKU_HOST_ROOT=$DOKKU_HOST_ROOT" >> /etc/default/dokku + chown dokku:dokku /etc/default/dokku + fi + NGINX_ROOT="/etc/nginx" if [[ -x /usr/bin/openresty ]]; then NGINX_ROOT="/usr/local/openresty/nginx/conf" From 9a1a97d56f34a7c2bb3ef14f40e5adb2573dca0e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 30 Sep 2021 01:48:52 -0400 Subject: [PATCH 2/2] docs: document DOKKU_HOST_ROOT --- docker/etc/my_init.d/10_dokku_init | 2 +- docs/getting-started/install/docker.md | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/etc/my_init.d/10_dokku_init b/docker/etc/my_init.d/10_dokku_init index c0a1579f3..f495142d4 100755 --- a/docker/etc/my_init.d/10_dokku_init +++ b/docker/etc/my_init.d/10_dokku_init @@ -64,7 +64,7 @@ main() { if [[ -n "$DOKKU_HOST_ROOT" ]]; then touch /etc/default/dokku - echo "export DOKKU_HOST_ROOT=$DOKKU_HOST_ROOT" >> /etc/default/dokku + echo "export DOKKU_HOST_ROOT=$DOKKU_HOST_ROOT" >>/etc/default/dokku chown dokku:dokku /etc/default/dokku fi diff --git a/docs/getting-started/install/docker.md b/docs/getting-started/install/docker.md index 094c11a37..d1ee556ed 100644 --- a/docs/getting-started/install/docker.md +++ b/docs/getting-started/install/docker.md @@ -11,6 +11,7 @@ Next, run the image. ```shell docker container run \ --env DOKKU_HOSTNAME=dokku.me \ + --env DOKKU_HOST_ROOT=/var/lib/dokku/home/dokku \ --name dokku \ --publish 3022:22 \ --publish 8080:80 \ @@ -28,7 +29,8 @@ Dokku is run in the following configuration: - Container HTTP port 80 is exposed on the host as 8080. - Container HTTPS port 443 is exposed on the host as 8443. - Data within the container is stored on the host within the `/var/lib/dokku` directory. -- The docker socket is mounted into container +- Image build cache is set to the data dir + `/home/dokku`. +- The docker socket is mounted into container. Application repositories, plugin config, as well as plugin data are persisted to disk within the specified host directory for `/var/lib/dokku`.