On Mac, to run Docker, you need to create a Docker runtime environment through Docker Desktop. However, this thing is too heavy and the fan is always spinning. So I found a lightweight alternative to Docker Desktop, but it lacks a graphical interface.
Introduction#
Colima is a tool for running container runtimes and Kubernetes on MacOS with minimal setup.
The name Colima is derived from Container on Lima. Lima is a virtual machine tool that enables automatic file sharing, port forwarding, and containerd.
Colima actually starts a virtual machine named colima through Lima, using containerd in the virtual machine as the container runtime.
Usage#
Colima is easy to use, just execute the following command to create a virtual machine, which defaults to Docker runtime.
colima start
INFO[0000] starting colima
INFO[0000] creating and starting ... context=vm
INFO[0119] provisioning ... context=docker
INFO[0119] provisioning in VM ... context=docker
INFO[0133] restarting VM to complete setup ... context=docker
INFO[0133] stopping ... context=vm
INFO[0136] starting ... context=vm
INFO[0158] starting ... context=docker
INFO[0159] done
At this point, you can use Docker-related commands on the host machine.
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
docker pull busybox
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
busybox latest b34806a1af7a 2 weeks ago 1.41MB
You can also use Lima's command line tool limactl to check the status of the virtual machine.
limactl list
NAME STATUS SSH ARCH CPUS MEMORY DISK DIR
colima Running 127.0.0.1:64505 aarch64 2 2GiB 60GiB /Users/addo/.lima/colima
Virtual Machine Configuration#
The virtual machine started by Colima defaults to 2 CPUs, 2GiB memory, and 60GiB storage. You can allocate more resources by using --cpu, --memory, and --disk when creating.
colima start --cpu 4 --memory 16
You can also modify the configuration of the current virtual machine:
colima stop
colima start --cpu 4 --memory 16
Of course, Colima also supports containerd besides Docker.
Before that, delete the previously generated virtual machine.
colima stop
colima delete
Then create a new virtual machine.
colima start --runtime containerd
After creation, view the containers.
colima nerdctl ps
Or run a container.
colima nerdctl container run nginx
In addition to containerd, Colima also supports creating Kubernetes.
colima start --with-kubernetes
Supports customizing virtual machine size.
colima start --cpu 4 --memory 16