From a93e180a898ba06f5b451b3313718626ca9ce12c Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Thu, 31 Mar 2016 15:29:04 -0700 Subject: [PATCH] filter restart policies from exec-app-json containers --- plugins/00_dokku-standard/exec-app-json-scripts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/00_dokku-standard/exec-app-json-scripts b/plugins/00_dokku-standard/exec-app-json-scripts index 7a2cf87af..43a586676 100755 --- a/plugins/00_dokku-standard/exec-app-json-scripts +++ b/plugins/00_dokku-standard/exec-app-json-scripts @@ -36,8 +36,13 @@ execute_script() { local COMMAND+=" echo removing installation cache... ; " local COMMAND+=" rm -f /tmp/cache || true ; " local COMMAND+=" exit \$RC " - local DOCKER_ARGS=$(: | plugn trigger docker-args-deploy "$APP") local CACHE_DIR="$DOKKU_ROOT/$APP/cache" + + local DOCKER_ARGS_RESTART_RE="(.*)--restart=.+([\s,$])" + local DOCKER_ARGS=$(: | plugn trigger docker-args-deploy "$APP") + # strip --restart args from DOCKER_ARGS + local DOCKER_ARGS=$(sed -e "s/--restart=[[:graph:]]\+[[:blank:]]\?//g" <<< "$DOCKER_ARGS") + # shellcheck disable=SC2086 local id=$(docker run "$DOKKU_GLOBAL_RUN_ARGS" --label=dokku_phase_script="${PHASE_SCRIPT_KEY}" -d -v "$CACHE_DIR:/cache" $DOCKER_ARGS "$IMAGE" /bin/bash -c "$COMMAND") test "$(docker wait "$id")" -eq 0 || (dokku_container_log_verbose_quiet "$id"; exit 1)