From 31dd2ee85673420a7064cda6c1251f9ed8dd009c Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 14 Feb 2019 10:47:07 +0000 Subject: [PATCH 1/2] brew.sh: allow Docker to run as root. --- Library/Homebrew/brew.sh | 3 +++ 1 file changed, 3 insertions(+) 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 From 019d97b4c8011d19e66197474bb4e68340b801dd Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 15 Feb 2019 10:05:10 +0000 Subject: [PATCH 2/2] Dockerfile: remove `USER linuxbrew`. This defaults to `root` but we still want to keep a Linuxbrew user on the system. --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9c7e1dfda5..bf7e85ee2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,6 @@ RUN cd /home/linuxbrew/.linuxbrew \ && cd /home/linuxbrew/.linuxbrew/Homebrew \ && git remote set-url origin https://github.com/Homebrew/brew -USER linuxbrew WORKDIR /home/linuxbrew ENV PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH \ SHELL=/bin/bash \