From 751180ae013221ef8782e16c741ac6dc9c1fd5f0 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Sun, 24 May 2015 13:22:58 -0700 Subject: [PATCH] Force developers not to run build-docker-image as root Instead recommend developer run build within the docker group. This script is non-functional as the root user. Change-Id: Ib70ab55e5e9bc2e7b8639d5d5ffc32a2b8795058 --- tools/build-docker-image | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/build-docker-image b/tools/build-docker-image index da819dde31..06e95a326c 100755 --- a/tools/build-docker-image +++ b/tools/build-docker-image @@ -1,5 +1,10 @@ #!/bin/bash +if [[ $EUID -eq 0 ]]; then + echo "This script must not be run as root. Instead add yourself to the docker group." 1>&2 + exit 1 +fi + TOPDIR=$(git rev-parse --show-toplevel) IMGDIR="$(cd "$(dirname "$0")" && pwd)"