#3324: Update Dockerfile to support Homebrew and Go for skill execution
docker
Cluster:
Docker Enhancements and Fixes
Description:
This PR introduces changes to the Dockerfile to include the installation of Homebrew and the Go programming language. These additions are required to ensure compatibility with specific skills that depend on the Go runtime or binaries managed via Homebrew.
Motivation:
Currently, the environment lacks the necessary tooling to run .
To support the installation and execution of these skills, we need to:
Integrate Homebrew as a package manager.
Install the Go compiler and toolchain.
Technical Details:
Since Homebrew strictly refuses to run as the root user for security reasons, the installation process required the following structural changes:
User Creation: A dedicated user (linuxbrew) is created with a home directory and bash shell.
Sudo Privileges: The user is granted NOPASSWD sudo access. This is necessary because Homebrew scripts often require elevated permissions to create directories and symlinks in system locations during the installation process, even if the core installation happens in the user's home folder.
Installation: Homebrew is bootstrapped via the official install script, running under the linuxbrew user context.
Environment Setup: The PATH environment variable is updated to include /home/linuxbrew/.linuxbrew/bin and /home/linuxbrew/.linuxbrew/sbin, making brew and installed binaries (like go) globally accessible.
Go Installation: The go formula is installed via Homebrew.
Root Restoration: The Dockerfile switches back to the root user at the end. This ensures that any subsequent system-level configurations or the main container process can run with the expected default permissions.
Changes:
Added linuxbrew user setup.
Integrated Homebrew installation logic.
Installed Go (brew install go).
Configured environment variables for the new paths.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the Docker build environment to support skills that rely on Homebrew-managed binaries and the Go toolchain. It installs additional Debian packages, creates a dedicated `linuxbrew` user to satisfy Homebrew’s non-root requirement, bootstraps Homebrew, adds brew paths to `PATH`, installs Go via brew, and then switches back to `root` before continuing the existing Node/Bun/corepack build steps.
The changes are confined to the `Dockerfile` and primarily affect image security posture (sudoers), reproducibility (unpinned `brew update`/installer), and image size/build determinism (apt layer cleanup).
<h3>Confidence Score: 3/5</h3>
- Moderate risk to merge due to security/reproducibility concerns in the Docker build steps.
- The functional intent is clear and limited to the Dockerfile, but the new passwordless sudo entry and unpinned Homebrew installer/update reduce security hardening and make builds non-deterministic; these are fixable with small Dockerfile adjustments.
- Dockerfile
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#8362: Add Homebrew-based Docker image
by bugparty · 2026-02-03
85.5%
#7489: feat: add brew to Dockerfile
by k2589 · 2026-02-02
85.4%
#12629: Dockerfile: pre-install common CLI tools for agent runtime
by jhs129 · 2026-02-09
79.3%
#11818: fix(docker): resolve build hang by using in-place ownership and opt...
by dilly · 2026-02-08
78.7%
#23079: fix(skills): fallback to npm for summarize skill on non-darwin systems
by charojo · 2026-02-22
78.6%
#9190: feat(docker): Add autonomous container self-restart and runtime pac...
by alexdredmon · 2026-02-05
78.5%
#7133: feat: Automated Docker setup with environment-based configuration
by synetalsolutions · 2026-02-02
77.0%
#3240: Fix Docker build failures on Windows/WSL environments
by Attili-sys · 2026-01-28
76.6%
#5458: fix: set correct file ownership in Dockerfile (#5450)
by hakyonglee · 2026-01-31
76.5%
#6631: fix: configure npm global prefix for non-root user in Docker
by tjetzinger · 2026-02-01
76.2%