diff --git a/support/rundk b/support/rundk index adf2ded..f959e00 100755 --- a/support/rundk +++ b/support/rundk @@ -371,7 +371,7 @@ OPTIONS gid="$(id -g)" args=( run -it --rm - --name rundk + --name "rundk-$(basename -- "$1")-$$" -e _RUNDK_IN_DOCKER=1 -e _RUNDK_UID="$uid" -e _RUNDK_GID="$gid" @@ -416,7 +416,7 @@ OPTIONS args+=( "$IMAGE" - exec "$MYSELF" ${Chdir:+-w "$Chdir"} + exec "$0" ${Chdir:+-w "$Chdir"} ) [ -n "$ForcedBootstrap" ] && set -- ci [ -n "$Verbose" ] && eecho "\$ docker ${args[*]} $*" @@ -472,6 +472,6 @@ else if [ -n "$chdir" ]; then cd "$chdir" || exit 1 fi - command "${@:-bash}" + exec "${@:-bash}" fi fi diff --git a/support/template.sh b/support/template.sh new file mode 100755 index 0000000..c92b292 --- /dev/null +++ b/support/template.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 +# Modèle de script utilisant rundk pour lancer un traitement dans un container + +MYDIR="$(dirname -- "$0")"; MYNAME="$(basename -- "$0")" +[ -n "$_RUNDK_IN_DOCKER" ] || +exec "$MYDIR/rundk" --bootstrap --unless-exists --exec -- "$MYDIR/$MYNAME" "$@" +source "$MYDIR/../vendor/nulib/php/load.sh" || exit 1 + +args=( + "description" + #"usage" +) +parse_args "$@"; set -- "${args[@]}" + +echo "je tourne dans un container..." +sleep 1000