-
Notifications
You must be signed in to change notification settings - Fork 0
/
lima.yaml
92 lines (87 loc) · 2.79 KB
/
lima.yaml
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
arch: default
images:
- location: "~/Downloads/impish-server-cloudimg-amd64.img"
arch: "x86_64"
- location: "~/Downloads/impish-server-cloudimg-arm64.img"
arch: "aarch64"
- location: https://github.com/lima-vm/alpine-lima/releases/download/v0.2.0/alpine-lima-rd-3.13.5-aarch64.iso
arch: "aarch64"
digest: "sha512:59c2dc5257be4d7dd05de6c64fcebae710f4e6eb993c784379a562be290cc957d5c8f2aef0d4c0c90a6fae5991218771e60e37a40a15414d2c169a6fdf534185"
- location: https://github.com/lima-vm/alpine-lima/releases/download/v0.2.0/alpine-lima-rd-3.13.5-x86_64.iso
arch: "x86_64"
digest: "sha512:73953b3f4e9dee279b058f51b323e430697d2e305b391d997046c3ef0468a6cb7f445144653d297c68cd294d4d0264e01bed114fc3555501b3a733759505f929"
cpus: 4
memory: 8GiB
disk: 50GiB
hostResolver:
enabled: false
dns:
- 8.8.8.8
- 4.4.4.4
mounts:
- location: "~/src"
writable: true
- location: "~/tmp"
writable: true
- location: "~/woo_dev"
writable: true
- location: "/tmp/lima/tempimage"
writable: true
- location: "/tmp/lima"
writable: true
- location: "~/.config"
writable: true
- location: "~/.lima"
writable: false
ssh:
localPort: 10000
loadDotSSHPubKeys: true
forwardAgent: false
containerd:
system: false
user: false
provision:
- mode: system
script: |
#!/bin/bash
set -eux -o pipefail
# Add our user into the 'docker' group so that we don't have to sudo
usermod -aG docker $LIMA_CIDATA_USER
# Start Docker
/etc/init.d/docker start
# Fix clock drift by syncing with host
max_attempts=5
attempts=0
until docker run --rm --privileged alpine hwclock -s
do
attempts=$((attempts+1))
echo "WARNING: Unable to sync clock with host; trying again in 1 second"
sleep 1
done
# Enable multi-arch support
# If you need support for other architectures like s90x or PPC,
# run the command below manually and provide the target arch at the end
if uname -m | grep -Eiq 'aarch|arm'
then docker run --rm --privileged aptman/qus -s -- -p x86_64
else docker run --rm --privileged aptman/qus -s -- -p arm
fi
# Add a cron job to keep the time synced up
echo 'ntpd -d -q -n -p pool.ntp.org' > /etc/periodic/15min/sync-the-time
chmod +x /etc/periodic/15min/sync-the-time
probes:
- script: |
#!/bin/bash
set -eux -o pipefail
if ! timeout 30s bash -c "until command -v docker ps >/dev/null 2>&1; do sleep 3; done"; then
echo >&2 "docker is not installed yet"
exit 1
fi
hint: See "/var/log/cloud-init-output.log". in the guest
firmware:
legacyBIOS: true
video:
display: "none"
propagateProxyEnv: true
portForwards:
- guestSocket: "/var/run/docker.sock"
hostSocket: "{{.Home}}/.lima/docker.sock"