Skip to content

Commit ada31bf

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 ada31bf

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-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: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Homebrew on Linux.
2+
#
3+
# Useful for sandboxing `brew` in an isolated environment.
4+
#
5+
# This template does not use macOS as the guest OS, because it seems hard to automate
6+
# provisioning macOS instances (accept EULA, skip enabling iCloud, set up SSH...).
7+
8+
minimumLimaVersion: 1.1.0
9+
10+
base:
11+
- template://_images/ubuntu-lts
12+
# Remove this line to disable the mounts
13+
- template://_default/mounts
14+
15+
# containerd should be installed via Homebrew when Homebrew supports it
16+
containerd:
17+
system: false
18+
user: false
19+
20+
provision:
21+
- mode: data
22+
path: /etc/profile.d/99-linuxbrew.sh
23+
# nofile is increased due to https://github.com/Homebrew/brew/issues/9120
24+
content: |
25+
ulimit -n 65536
26+
[ -e /home/linuxbrew/.linuxbrew/bin/brew ] && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
27+
- mode: system
28+
script: |
29+
#!/bin/bash
30+
set -eux -o pipefail
31+
command -v gcc >/dev/null 2>&1 && exit 0
32+
export DEBIAN_FRONTEND=noninteractive
33+
apt-get update
34+
apt-get install -y build-essential
35+
- mode: user
36+
script: |
37+
#!/bin/bash
38+
set -eux -o pipefail
39+
[ -e /home/linuxbrew ] && exit 0
40+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

0 commit comments

Comments
 (0)