Use DOKKU_ROOT_ON_HOST for Docker bind mounts

This commit is contained in:
Jody McIntyre
2018-04-09 17:51:14 -04:00
parent 13bd5864b3
commit aa5561b781
6 changed files with 12 additions and 7 deletions

View File

@@ -19,6 +19,7 @@ apps_clone_cmd() {
[[ -z "$OLD_APP" ]] && dokku_log_fail "Please specify an app to run the command on"
[[ -d "$DOKKU_ROOT/$NEW_APP" ]] && dokku_log_fail "Name is already taken"
local NEW_CACHE_DIR="$DOKKU_ROOT/$NEW_APP/cache"
local NEW_CACHE_DIR_ON_HOST="$DOKKU_ROOT_ON_HOST/$NEW_APP/cache"
apps_create "$NEW_APP"
pushd "$DOKKU_ROOT/$OLD_APP/." > /dev/null
@@ -26,7 +27,7 @@ apps_clone_cmd() {
popd > /dev/null 2>&1 || pushd "/tmp" > /dev/null
if [[ -d "$NEW_CACHE_DIR" ]] && ! rmdir "$NEW_CACHE_DIR"; then
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$NEW_CACHE_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$NEW_CACHE_DIR_ON_HOST:/cache" "dokku/$OLD_APP" chmod 777 -R /cache
fi
rm -rf "$NEW_CACHE_DIR"