diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index c24f47fcaf..c7c42a6c4d 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -350,6 +350,9 @@ fi check-run-command-as-root() { [[ "$(id -u)" = 0 ]] || return + # Allow Docker to do everything as root (as it's normal there) + [[ -f /proc/1/cgroup ]] && grep docker -q /proc/1/cgroup && return + # Homebrew Services may need `sudo` for system-wide daemons. [[ "$HOMEBREW_COMMAND" = "services" ]] && return