Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't prepend scope launch with sudo #1606

Merged
merged 4 commits into from
Jul 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
21 changes: 21 additions & 0 deletions scope
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -119,6 +139,7 @@ launch_app_command() {
$WEAVESCOPE_DOCKER_ARGS $SCOPE_IMAGE --no-probe "$@"
}

check_docker_access
check_docker_version

case "$COMMAND" in
Expand Down
4 changes: 2 additions & 2 deletions site/installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,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.

Expand All @@ -42,7 +42,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,

Expand Down
2 changes: 1 addition & 1 deletion site/introducing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down