Skip to content

Commit 2516450

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 56702e0 commit 2516450

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-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: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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 desigined 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+
base: "template://ubuntu-lts"
21+
22+
# mounts are inherited from the base template by default
23+
# ```
24+
# mounts: null
25+
# ```
26+
27+
# containerd should be installed via Homebrew when Homebrew supports it
28+
containerd:
29+
system: false
30+
user: false
31+
32+
provision:
33+
- mode: system
34+
script: |
35+
#!/bin/bash
36+
set -eux -o pipefail
37+
command -v gcc >/dev/null 2>&1 && exit 0
38+
39+
# nofile has to be increased: https://github.com/Homebrew/brew/issues/9120
40+
cat <<'EOF' >/etc/profile.d/99-linuxbrew.sh
41+
ulimit -n 65536
42+
[ -e /home/linuxbrew/.linuxbrew/bin/brew ] && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
43+
EOF
44+
45+
export DEBIAN_FRONTEND=noninteractive
46+
apt-get update
47+
apt-get install -y build-essential
48+
- mode: user
49+
script: |
50+
#!/bin/bash
51+
set -eux -o pipefail
52+
[ -e /home/linuxbrew ] && exit 0
53+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

0 commit comments

Comments
 (0)