mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Merge pull request #1606 from weaveworks/1594-no-sudo-for-launch
Don't prepend `scope launch` with sudo
This commit is contained in:
@@ -32,7 +32,7 @@ Interact with your containers directly: pause, restart and stop containers. Laun
|
||||
```
|
||||
sudo wget -O /usr/local/bin/scope https://git.io/scope
|
||||
sudo chmod a+x /usr/local/bin/scope
|
||||
sudo scope launch
|
||||
scope launch
|
||||
```
|
||||
|
||||
This script will download and run a recent Scope image from the Docker Hub.
|
||||
|
||||
21
scope
21
scope
@@ -34,6 +34,26 @@ WEAVESCOPE_DOCKER_ARGS=${WEAVESCOPE_DOCKER_ARGS:-}
|
||||
COMMAND=$1
|
||||
shift 1
|
||||
|
||||
check_docker_access() {
|
||||
|
||||
# Extract socket path
|
||||
DOCKER_SOCK_FILE=""
|
||||
if [ -z "${DOCKER_HOST+x}" ]; then
|
||||
DOCKER_SOCK_FILE="/var/run/docker.sock"
|
||||
else
|
||||
WITHOUT_PREFIX="${DOCKER_HOST#unix://}"
|
||||
if [ "$WITHOUT_PREFIX" != "$DOCKER_HOST" ]; then
|
||||
DOCKER_SOCK_FILE="$WITHOUT_PREFIX"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ \( -n "$DOCKER_SOCK_FILE" \) -a \( ! -w "$DOCKER_SOCK_FILE" \) ]; then
|
||||
echo "ERROR: cannot write to docker socket: $DOCKER_SOCK_FILE" >&2
|
||||
echo "change socket permissions or try using sudo" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# - The image embeds the weave script & Docker 1.3.1 client
|
||||
# - Docker versions prior to 1.5.0 do not support --pid=host
|
||||
# - Weave needs 1.6.0 now (image pulling changes)
|
||||
@@ -119,6 +139,7 @@ launch_app_command() {
|
||||
$WEAVESCOPE_DOCKER_ARGS $SCOPE_IMAGE --no-probe "$@"
|
||||
}
|
||||
|
||||
check_docker_access
|
||||
check_docker_version
|
||||
|
||||
case "$COMMAND" in
|
||||
|
||||
@@ -31,7 +31,7 @@ To install Scope onto your local Docker machine in standalone mode, run the foll
|
||||
|
||||
sudo wget -O /usr/local/bin/scope https://git.io/scope
|
||||
sudo chmod a+x /usr/local/bin/scope
|
||||
sudo scope launch
|
||||
scope launch
|
||||
|
||||
This script downloads and runs a recent Scope image from the Docker Hub. Scope needs to be installed onto every machine that you want to monitor. Once launched, Scope doesn’t require any other configuration and it also doesn’t depend on Weave Net.
|
||||
|
||||
@@ -49,7 +49,7 @@ Then, install Scope onto your local Docker machine and start using Weave Cloud:
|
||||
|
||||
sudo wget -O /usr/local/bin/scope https://git.io/scope
|
||||
sudo chmod a+x /usr/local/bin/scope
|
||||
sudo scope launch --service-token=<token>
|
||||
scope launch --service-token=<token>
|
||||
|
||||
Where,
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ To install Scope on your local Docker machine, run the following commands:
|
||||
|
||||
sudo wget -O /usr/local/bin/scope https://git.io/scope
|
||||
sudo chmod a+x /usr/local/bin/scope
|
||||
sudo scope launch
|
||||
scope launch
|
||||
|
||||
Scope can be used in standalone mode, where you deploy it locally onto your hosts, or you can use Weave Scope in Service Mode. Scope can be depoloyed to Kubernetes, DCOS and ECS cluster. See [Installing Weave Scope](/site/installing.md) for more information.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user