From 0d2e2cda8fc45044c084fe1e15be2809dc255503 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Mon, 25 Apr 2016 14:00:02 +0100 Subject: [PATCH] Detect if sudo is required by running 'docker info' --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a91dec037..a61f35252 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: all deps static clean client-lint client-test client-sync backend frontend shell lint # If you can use Docker without being root, you can `make SUDO= ` -SUDO=$(shell (echo "$$DOCKER_HOST" | grep "tcp://" >/dev/null) || echo "sudo -E") +SUDO=$(shell docker info >/dev/null 2>&1 || echo "sudo -E") DOCKERHUB_USER=weaveworks SCOPE_EXE=prog/scope SCOPE_IMAGE=$(DOCKERHUB_USER)/scope