Merge pull request #5733 from MikeMcQuaid/docker-root

brew.sh: allow Docker to run as root.
This commit is contained in:
Mike McQuaid 2019-02-15 10:54:08 +00:00 committed by GitHub
commit 2ca56f6731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -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 \

View File

@ -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