@@ -13,6 +13,7 @@ RUN apt-get update && \
1313 snapd \
1414 python3 \
1515 python3-pip \
16+ python3.12-venv \
1617 ruby \
1718 ruby-dev \
1819 flatpak-builder \
@@ -30,6 +31,8 @@ RUN locale-gen en_US.UTF-8
3031ENV LANG=en_US.UTF-8
3132ENV LANGUAGE=en_US:en
3233ENV LC_ALL=en_US.UTF-8
34+
35+
3336# Install snapd (for snap builds; install snaps at runtime)
3437#RUN apt-get update && apt-get install -y --no-install-recommends snapd && rm -rf /var/lib/apt/lists/*
3538# NOTE: To use snapcraft, start the container and run:
@@ -41,10 +44,6 @@ RUN gem install --no-document fpm
4144# Install bats (for shell testing)
4245RUN npm install -g bats
4346
44- # Install Homebrew (for homebrew builds, on Linux)
45- RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" || true
46- ENV PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH"
47- RUN brew update || true
4847
4948# Install GitHub CLI (gh)
5049RUN type -p gh || (curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | \
@@ -54,6 +53,31 @@ RUN type -p gh || (curl -fsSL https://cli.github.com/packages/githubcli-archive-
5453 tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \
5554 apt-get update && apt-get install -y gh)
5655
56+ # Install Homebrew (for homebrew builds, on Linux)
57+
58+ # 2) Ensure UTF-8 locale (prevents brew warnings)
59+ RUN localedef -i en_US -f UTF-8 en_US.UTF-8
60+
61+ # 3) Create a non-root user for Homebrew
62+ RUN useradd -m -s /bin/bash linuxbrew && \
63+ echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
64+
65+ # 4) Switch to that user and install Homebrew (non-interactively)
66+ USER linuxbrew
67+ ENV CI=1 NONINTERACTIVE=1
68+ RUN /bin/bash -c \
69+ "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
70+
71+ ENV PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}"
72+
73+ # 6) Verify brew works
74+ RUN brew --version && brew update --quiet
75+
76+ # # 5) Switch back to root, expose brew on PATH
77+ USER root
78+ ENV PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}"
79+
80+
5781# Set workdir
5882WORKDIR /workspace
5983
0 commit comments