Skip to content

Commit b6388b3

Browse files
committed
book: document how to use Lima on macOS for development
1 parent be86b82 commit b6388b3

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

docs/book/src/developer/guide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ You'll need the [docker daemon][docker] v19.03 or newer available.
2525

2626
[docker]: https://docs.docker.com/install/
2727

28+
On MacOS systems using [Lima](https://github.com/lima-vm/lima) is a viable alternative to Docker Desktop.
29+
2830
### A Cluster
2931

3032
You'll likely want an existing cluster as your [management cluster][mcluster].

docs/book/src/developer/tilt.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ workflow that offers easy deployments and rapid iterative builds.
77

88
## Prerequisites
99

10-
1. [Docker](https://docs.docker.com/install/): v19.03 or newer
10+
1. [Docker](https://docs.docker.com/install/): v19.03 or newer (on MacOS e.g. via [Lima](https://github.com/lima-vm/lima))
1111
2. [kind](https://kind.sigs.k8s.io): v0.24.0 or newer
1212
3. [Tilt](https://docs.tilt.dev/install.html): v0.30.8 or newer
1313
4. [kustomize](https://github.com/kubernetes-sigs/kustomize): provided via `make kustomize`
@@ -507,6 +507,28 @@ syntax highlighting and auto-formatting. To enable it for Tiltfile a file associ
507507

508508
NB: The socket defined by `DOCKER_HOST` is used only for the `hack/tools/internal/tilt-prepare` command, the image build is running the `podman build`/`podman push` commands.
509509

510+
## Using Lima
511+
512+
[Lima] can be used instead of Docker Desktop. Please note that especially with CAPD the rootless template of Lima does not work.
513+
514+
The following command creates a working Lima machine for developing Cluster API with CAPD:
515+
516+
```bash
517+
limactl start template://docker-rootful --name "docker" --tty=false \
518+
--set '.provision += {"mode":"system","script":"#!/bin/bash\nset -eux -o pipefail\ncat << EOF > \"/etc/sysctl.d/99-capi.conf\"\nfs.inotify.max_user_watches = 1048576\nfs.inotify.max_user_instances = 8192\nEOF\nsysctl -p \"/etc/sysctl.d/99-capi.conf\""}' \
519+
--set '.mounts[0] = {"location": "~", "writable": true}' \
520+
--memory 12 --cpus 10 --disk 64 \
521+
--vm-type vz --rosetta=true
522+
```
523+
524+
After creating the Lima machine we need to set `DOCKER_HOST` to the correct path:
525+
526+
```bash
527+
export DOCKER_HOST=$(limactl list "docker" --format 'unix://{{.Dir}}/sock/docker.sock')
528+
```
529+
530+
[Lima]: https://github.com/lima-vm/lima
531+
510532
## Troubleshooting Tilt
511533

512534
### Tilt is stuck

0 commit comments

Comments
 (0)