Skip to content

Commit e3542a5

Browse files
committed
templates: add linuxbrew
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...). To run Homebrew on macOS with a sandbox, Alcoholless can be used instead. The `alclessctl` CLI of Alcoholless is desigined to be similar to `limactl`: https://github.com/AkihiroSuda/alcless ``` alclessctl create default cd ~/SOME_DIRECTORY alcless brew install xz alcless xz SOME_FILE ``` Signed-off-by: Akihiro Suda <[email protected]>
1 parent 2adaf1d commit e3542a5

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

templates/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ Distro:
3333
- [`experimental/opensuse-tumbleweed`](./experimental/opensuse-tumbleweed.yaml): [experimental] openSUSE Tumbleweed
3434
- [`experimental/debian-sid`](./experimental/debian-sid.yaml): [experimental] Debian Sid
3535

36+
Alternative package managers:
37+
- [`linuxbrew.yaml`](./linuxbrew.yaml): [Homebrew](https://brew.sh) on Linux (Ubuntu)
38+
3639
Container engines:
3740
- [`apptainer`](./apptainer.yaml): Apptainer
3841
- [`apptainer-rootful`](./apptainer-rootful.yaml): Apptainer (rootful)

templates/linuxbrew.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Homebrew on Linux.
2+
#
3+
# This template does not use macOS as the guest OS, because it seems hard to automate
4+
# provisioning macOS instances (accept EULA, skip enabling iCloud, set up SSH...).
5+
#
6+
# To run Homebrew on macOS with a sandbox user account, Alcoholless can be used instead.
7+
# The `alclessctl` CLI of Alcoholless is designed to be similar to `limactl`:
8+
# https://github.com/AkihiroSuda/alcless
9+
#
10+
# ```
11+
# alclessctl create default
12+
# cd ~/SOME_DIRECTORY
13+
# alcless brew install xz
14+
# alcless xz SOME_FILE
15+
# ```
16+
#
17+
# Eventually, Alcoholless may be consolidated into Lima.
18+
19+
minimumLimaVersion: 1.1.0
20+
21+
base:
22+
- template://_images/ubuntu-24.10
23+
# Remove this line to disable the mounts
24+
- template://_default/mounts
25+
26+
# containerd should be installed via Homebrew when Homebrew supports it
27+
containerd:
28+
system: false
29+
user: false
30+
31+
provision:
32+
- mode: system
33+
script: |
34+
#!/bin/bash
35+
set -eux -o pipefail
36+
command -v gcc >/dev/null 2>&1 && exit 0
37+
38+
# nofile has to be increased: https://github.com/Homebrew/brew/issues/9120
39+
cat <<'EOF' >/etc/profile.d/99-linuxbrew.sh
40+
ulimit -n 65536
41+
[ -e /home/linuxbrew/.linuxbrew/bin/brew ] && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
42+
EOF
43+
44+
export DEBIAN_FRONTEND=noninteractive
45+
apt-get update
46+
apt-get install -y build-essential
47+
- mode: user
48+
script: |
49+
#!/bin/bash
50+
set -eux -o pipefail
51+
[ -e /home/linuxbrew ] && exit 0
52+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

0 commit comments

Comments
 (0)