Published 2024-11-14 20:31:55
Running Docker on macOS Without Docker Desktop
If you’re using macOS and want to run the Docker daemon without relying on Docker Desktop, you can still do it. However, since macOS lacks native support for Linux technologies like cgroups and namespaces (which Docker relies on), you’ll need a virtualization layer to run containers. On Linux, Docker can run natively using the kernel’s built-in support for these features, but on macOS, this isn’t possible due to differences in the operating system.
Fortunately, tools like Colima can help with this by providing a lightweight, Linux-based virtual machine optimized for running containers.
What is Colima?
Colima (short for “Containers on Lima”) is an open-source tool that provides a Linux virtual machine on macOS, specifically optimized for running container workloads. It uses Lima, which is a lightweight VM manager, to create a Linux environment on your Mac. Colima is designed to be an alternative to Docker Desktop, with several advantages:
- Lightweight: Colima is optimized to be efficient in terms of resource usage (CPU, memory).
- Performance: It supports container technologies like Docker and Kubernetes, leveraging the underlying Linux VM.
- Compatibility: Provides support for Docker and Kubernetes, with features like automatic volume mounting and network port forwarding.
- Flexibility: Colima allows for easy configuration of CPU, memory, and disk resources, making it a great option for developers.
Installations
Install Colima:
brew install colima
Install Docker CLI:
brew install docker
Start Colina with Docker Runtime:
colima start --runtime docker
Let's test it:
docker run hello-world
Output:
Hello from Docker!
You can find more information about the Colima project here
This was a short and concise post. See you soon!