From 557d5558588e647dddb352c0174a0ea57c6e3637 Mon Sep 17 00:00:00 2001 From: Paul Lietar Date: Wed, 20 Nov 2013 20:42:15 +0000 Subject: [PATCH] Delete the /cache directory's contents from inside the container. Fixes #322. Buildpacks write into /cache as root, which made the delete command unable to delete it. Its contents are now deleted using "docker run", and thus as root. --- plugins/00_dokku-standard/pre-delete | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 plugins/00_dokku-standard/pre-delete diff --git a/plugins/00_dokku-standard/pre-delete b/plugins/00_dokku-standard/pre-delete new file mode 100755 index 000000000..8e057941a --- /dev/null +++ b/plugins/00_dokku-standard/pre-delete @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +APP="$1" +IMAGE=app/"$1" +CACHE_DIR="$HOME/$APP/cache" + +docker run -v $CACHE_DIR:/cache $IMAGE find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; + +