mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
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.
This commit is contained in:
10
plugins/00_dokku-standard/pre-delete
Executable file
10
plugins/00_dokku-standard/pre-delete
Executable file
@@ -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 {} \;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user