only pass WEAVESCOPE_DOCKER_ARGS to actual probe/app start

and not all the help, version, etc, etc docker runs.

In particular this allows passing `--restart=...` in
WEAVESCOPE_DOCKER_ARGS. Previously that would break since the
non-probe/app docker runs supply `--rm` (as they should) which is
incompatible with restart settings.
This commit is contained in:
Matthias Radestock
2017-07-14 09:36:05 +01:00
parent 2ca81217b7
commit e19c33b4c2

12
scope
View File

@@ -48,8 +48,7 @@ usage() {
Launch options:
EOF
# shellcheck disable=SC2086
docker run --rm -e CHECKPOINT_DISABLE --entrypoint=/home/weave/scope \
$WEAVESCOPE_DOCKER_ARGS "$SCOPE_IMAGE" -h >&2
docker run --rm -e CHECKPOINT_DISABLE --entrypoint=/home/weave/scope "$SCOPE_IMAGE" -h >&2
}
usage_and_die() {
@@ -177,14 +176,13 @@ docker_args() {
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/run/scope/plugins:/var/run/scope/plugins \
-v /sys/kernel/debug:/sys/kernel/debug \
-e CHECKPOINT_DISABLE \
$WEAVESCOPE_DOCKER_ARGS
-e CHECKPOINT_DISABLE
}
launch_command() {
# shellcheck disable=SC2046
# shellcheck disable=SC2046,SC2086
echo docker run -d --name="$SCOPE_CONTAINER_NAME" $(docker_args) \
"$SCOPE_IMAGE" --probe.docker=true
$WEAVESCOPE_DOCKER_ARGS "$SCOPE_IMAGE" --probe.docker=true
}
launch_docker4mac_app_command() {
@@ -237,7 +235,7 @@ case "$COMMAND" in
version)
# shellcheck disable=SC2086
docker run --rm -e CHECKPOINT_DISABLE --entrypoint=/home/weave/scope \
$WEAVESCOPE_DOCKER_ARGS "$SCOPE_IMAGE" --mode=version
"$SCOPE_IMAGE" --mode=version
;;
-h | help | -help | --help)