Lima is Linux virtual machines (on macOS, in most cases). Lima launches Linux virtual machines with automatic file sharing and port forwarding (similar to WSL2), and containerd. Lima can be considered as a some sort of unofficial “containerd for Mac”. Lima is expected to be used on macOS hosts, but can be used on Linux hosts as well.
Steps to install Lima-VM (alternative to docker) and use it with kubernetes on Mac:
- Instal lima
brew install lima
- start lima
limactl start
- Check uname
lima uname -aLinux lima-default 5.19.0-26-generic #27-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 23 20:49:05 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
- Open shell to VM
lima
- Create a container using lima directly
lima nerdctl run -p 8001:80 --name nginx -d nginx
- List all containers
lima nerdctl ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3c57f17c0986 docker.io/library/nginx:latest "/docker-entrypoint.…" About a minute ago Up 0.0.0.0:8081->80/tcp nginx
- Get a shell to above container
lima nerdctl exec -it nginx /bin/bash
- Stop, rm and start container again
lima nerdctl stop nginx
lima nerdctl rm nginx
lima nerdctl start nginx - Install minikube and start it using drive qemu
brew install minikube
minikube start --driver=qemu
minikube dashboard - Create a simple pod (nginx) using kubectl
kubectl apply -f https://k8s.io/examples/pods/simple-pod.yam
l - Get a shell on nginx pod
kubectl exec -it nginx -- /bin/bash
(Please note that this container is attached to the pod and different from container created above using lima nerdctl) - To list instances, stop and delete
limactl list
limactl stop
limactl delete default