-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlima-wings.yaml
More file actions
124 lines (99 loc) · 3.19 KB
/
Copy pathlima-wings.yaml
File metadata and controls
124 lines (99 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Lima VM for running Wings locally on macOS
# Create: make lima-create
# Setup: make lima-setup
# Status: make lima-status
# Delete: make lima-delete
minimumLimaVersion: 1.0.0
cpus: 2
memory: 2GiB
disk: 20GiB
vmType: vz
mountType: virtiofs
images:
- location: "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-arm64.img"
arch: aarch64
mounts:
- location: "~/Downloads/realmctl/wings"
writable: true
portForwards:
- guestPort: 8080
hostPort: 8080
- guestPort: 2022
hostPort: 2022
containerd:
system: false
user: false
provision:
- mode: system
script: |
#!/bin/bash
set -eux -o pipefail
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get upgrade -y
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release \
jq
# Docker
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
> /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl enable --now docker
# Go 1.24 (required by wings/go.mod)
GOLANG_VERSION=1.24.1
curl -fsSL "https://go.dev/dl/go${GOLANG_VERSION}.linux-arm64.tar.gz" -o /tmp/go.tar.gz
rm -rf /usr/local/go
tar -C /usr/local -xzf /tmp/go.tar.gz
ln -sf /usr/local/go/bin/go /usr/local/bin/go
# Realm directories
useradd -m -s /bin/bash -u 988 realm 2>/dev/null || true
usermod -aG docker realm 2>/dev/null || true
mkdir -p /etc/realm
mkdir -p /var/lib/realm/{volumes,archives,backups}
mkdir -p /var/log/realm
mkdir -p /tmp/realm
mkdir -p /run/wings
chown -R realm:realm /var/lib/realm /var/log/realm
chmod -R 755 /var/lib/realm /var/log/realm /tmp/realm /run/wings
cat > /etc/systemd/system/wings.service <<'UNIT'
[Unit]
Description=Realm Wings Daemon
After=docker.service network-online.target
Wants=network-online.target
Requires=docker.service
[Service]
User=root
ExecStart=/usr/local/bin/wings --config /etc/realm/config.yml
Restart=on-failure
RestartSec=5
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
UNIT
systemctl daemon-reload
probes:
- description: "docker must be installed"
script: |
#!/bin/bash
command -v docker >/dev/null
hint: "Docker installation failed during provisioning."
message: |
Lima Wings VM is ready.
Build and start Wings:
make lima-setup
Open a shell in the VM:
limactl shell wings
Optional — reach VM IP directly from Mac (not just port-forward):
sudo brew services start socket_vmnet
Then recreate with "networks: [{lima: shared}]" in lima-wings.yaml
Check status: make lima-status