Skip to content

templates: add linuxbrew #3454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ Distro:
- [`experimental/opensuse-tumbleweed`](./experimental/opensuse-tumbleweed.yaml): [experimental] openSUSE Tumbleweed
- [`experimental/debian-sid`](./experimental/debian-sid.yaml): [experimental] Debian Sid

Alternative package managers:
- [`linuxbrew.yaml`](./linuxbrew.yaml): [Homebrew](https://brew.sh) on Linux (Ubuntu)

Container engines:
- [`apptainer`](./apptainer.yaml): Apptainer
- [`apptainer-rootful`](./apptainer-rootful.yaml): Apptainer (rootful)
Expand Down
40 changes: 40 additions & 0 deletions templates/linuxbrew.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Homebrew on Linux.
#
# Useful for sandboxing `brew` in an isolated environment.
#
# This template does not use macOS as the guest OS, because it seems hard to automate
# provisioning macOS instances (accept EULA, skip enabling iCloud, set up SSH...).

minimumLimaVersion: 1.1.0

base:
- template://_images/ubuntu-lts
# Remove this line to disable the mounts
- template://_default/mounts

# containerd should be installed via Homebrew when Homebrew supports it
containerd:
system: false
user: false

provision:
- mode: data
path: /etc/profile.d/99-linuxbrew.sh
# nofile is increased due to https://github.com/Homebrew/brew/issues/9120
content: |
ulimit -n 65536
[ -e /home/linuxbrew/.linuxbrew/bin/brew ] && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
- mode: system
script: |
#!/bin/bash
set -eux -o pipefail
command -v gcc >/dev/null 2>&1 && exit 0
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y build-essential
- mode: user
script: |
#!/bin/bash
set -eux -o pipefail
[ -e /home/linuxbrew ] && exit 0
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Loading