Menu

  • Home
  • Work
    • AI
    • Cloud
      • Virtualization
      • IaaS
      • PaaS
    • Architecture
    • BigData
    • Python
    • Java
    • Go
    • C
    • C++
    • JavaScript
    • PHP
    • Others
      • Assembly
      • Ruby
      • Perl
      • Lua
      • Rust
      • XML
      • Network
      • IoT
      • GIS
      • Algorithm
      • Math
      • RE
      • Graphic
    • OS
      • Linux
      • Windows
      • Mac OS X
    • Database
      • MySQL
      • Oracle
    • Mobile
      • Android
      • IOS
    • Web
      • HTML
      • CSS
  • Life
    • Cooking
    • Travel
    • Gardening
  • Gallery
  • Video
  • Music
  • Essay
  • Home
  • Work
    • AI
    • Cloud
      • Virtualization
      • IaaS
      • PaaS
    • Architecture
    • BigData
    • Python
    • Java
    • Go
    • C
    • C++
    • JavaScript
    • PHP
    • Others
      • Assembly
      • Ruby
      • Perl
      • Lua
      • Rust
      • XML
      • Network
      • IoT
      • GIS
      • Algorithm
      • Math
      • RE
      • Graphic
    • OS
      • Linux
      • Windows
      • Mac OS X
    • Database
      • MySQL
      • Oracle
    • Mobile
      • Android
      • IOS
    • Web
      • HTML
      • CSS
  • Life
    • Cooking
    • Travel
    • Gardening
  • Gallery
  • Video
  • Music
  • Essay

Replacing Docker Desktop with Colima on macOS

15
Mar
2026

Replacing Docker Desktop with Colima on macOS

By Alex
/ in IaaS
0 Comments

Colima is one of the cleanest ways to run containers locally on macOS. It starts a Linux virtual machine through Lima, runs Docker, containerd, and optional k3s Kubernetes inside that VM, then exposes the result to host-side tools such as docker and kubectl. This note covers how Colima works on macOS, how to install it, which settings matter in practice, how to verify the setup, and which operational details usually trip people up.

Containers on macOS

Containers are not lightweight macOS processes. They depend on Linux kernel features such as namespaces, cgroups, and OverlayFS. macOS does not provide those interfaces, so Linux containers on macOS always run on top of a Linux virtual machine.

That is the right starting point for understanding Colima. It does not bypass virtualization. It makes that layer lighter and easier to work with. Lima manages the Linux VM. Colima configures the container runtime inside it and ties that runtime into the host command-line workflow.

What Colima is

Colima is best understood as a developer-friendly layer on top of Lima. Lima handles VM lifecycle, file sharing, and port forwarding. Colima takes care of the container runtime and exposes it to the tools you already use on the host.

Three properties matter most in day-to-day use:

  • It gives macOS a local environment for Docker, containerd, and optional Kubernetes.
  • It works with the host CLI instead of forcing everything through a desktop application workflow.
  • It supports multiple profiles, with each profile backed by its own VM. That makes it easy to split a lightweight Docker setup from a heavier Kubernetes setup.
Why Colima

For local container development on macOS, the real question is usually not whether containers can run. They can. The question is whether the environment is easy to reason about. Colima is appealing for three simple reasons.

  • The structure is clear. Host CLI, Linux VM, and container runtime are separate layers, which makes troubleshooting easier.
  • The controls are explicit. CPU, memory, disk, architecture, Kubernetes, networking, and mount behavior can all be configured through flags or YAML.
  • It fits an engineering workflow better than a GUI-first workflow. Scripts, profiles, and repeatable setup steps all work naturally.

If Docker Desktop is already installed, you do not necessarily have to remove it first. What matters more is knowing which Docker context is active, otherwise commands may end up talking to the wrong daemon.

Installation

On macOS, the simplest installation path is Homebrew. If you use the Docker runtime, you need the Docker CLI on the host. If you want local Kubernetes, you also need kubectl.

Shell
1
brew install colima docker kubectl

The first startup can stay close to the defaults. The goal is just to confirm that the host CLI can talk to the VM-backed runtime.

Shell
1
2
3
colima start
docker run --rm hello-world
docker ps

If you only need a Docker daemon, that is enough. If you also want local Kubernetes, enable it at startup:

Shell
1
2
colima start --kubernetes
kubectl get nodes

If more than one Docker daemon exists on the machine, check the active context before assuming anything is broken:

Shell
1
2
docker context ls
docker context use colima
Common configuration

Colima accepts both command-line flags and persistent YAML configuration. In practice, colima start --edit is usually the safest entry point because it opens the current profile configuration, lets you change it, and then starts the instance.

The example below is a sensible local-development baseline. It removes private registry assumptions and keeps only the settings that are useful in a public, general-purpose setup.

colima.yaml
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
# Resource sizing. The defaults are fine for a single container,
# but small once you run an app stack and k3s together.
cpu: 4
memory: 8
disk: 100
 
# Immutable creation-time settings. Use the host architecture
# and keep Docker as the container runtime.
arch: host
runtime: docker
 
# Single-node k3s. Disable the default Traefik install so it
# does not collide with whatever ingress stack you already use.
kubernetes:
  enabled: true
  version: v1.35.0+k3s1
  k3sArgs:
    - --disable=traefik
 
# Give the VM a host-reachable address for debugging and direct checks.
network:
  address: true
  mode: shared
 
# On newer macOS versions, prefer Apple's virtualization framework.
vmType: vz
 
# On Apple Silicon, enable Rosetta for linux/amd64 userland binaries.
rosetta: true
 
# VZ plus virtiofs is a common high-performance combination on macOS.
mountType: virtiofs
 
# Make Docker and Kubernetes contexts active on startup.
autoActivate: true
 
# Install a small set of debugging tools inside the VM.
# Provision scripts should stay idempotent.
provision:
  - mode: system
    script: |
      apt-get update
      apt-get install -y vim curl htop git make dnsutils net-tools iputils-ping telnet
Configuration overview

The official documentation groups Colima settings into resources, VM settings, runtime settings, networking, mounts, SSH, provisioning, and environment variables. The table below summarizes the current upstream template, plus rootDisk, which is documented separately in the configuration guide.

Key Default Meaning Notes
cpu 2 Number of vCPUs assigned to the VM. Resource setting
memory 2 Memory assigned to the VM, in GiB. Resource setting
disk 100 Container data disk size, in GiB. Can only be increased after creation
rootDisk 20 Root filesystem disk size for the VM, in GiB. Documented in the config guide
arch host VM architecture, either the host architecture or an explicit override. Immutable after creation
runtime docker Container runtime. Immutable after creation
modelRunner docker Backend used for AI model execution. AI workload setting
hostname null Custom VM hostname. Defaults to colima or colima-<profile>
kubernetes.enabled false Turns the built-in k3s cluster on or off. Kubernetes group
kubernetes.version latest stable k3s version, which must match an actual k3s release string. Kubernetes group
kubernetes.k3sArgs --disable=traefik Extra arguments passed to the k3s server. Kubernetes group
kubernetes.port 0 Kubernetes API listen port. A value of 0 means "pick a free port". Kubernetes group
autoActivate true Makes Docker and Kubernetes contexts active on startup. Client-side behavior
network.address false Assigns a host-reachable IP address to the VM. macOS only
network.mode shared Network mode. The docs list shared and bridged. macOS only
network.interface en0 Host network interface used in bridged mode. Only used with bridged mode
network.preferredRoute false Uses the assigned VM IP as the preferred route. Requires address=true
network.dns [] Custom DNS resolvers for the VM. Network group
network.dnsHosts host.docker.internal: host.lima.internal Built-in DNS host mapping. Network group
network.hostAddresses false Replicates host IP addresses into the VM for more specific port forwarding behavior. Network group
network.gatewayAddress 192.168.5.2 Gateway address for the VM network. Last octet must be 2
forwardAgent false Forwards the host SSH agent into the VM. SSH group
docker {} Configuration block mapped directly into Docker daemon.json. Advanced setting
vmType qemu Virtualization backend. Immutable after creation
portForwarder ssh Port forwarding mechanism. Valid values are ssh, grpc, and none. Network group
rosetta false Enables amd64 userland emulation on Apple Silicon. Requires VZ
binfmt true Enables foreign-architecture binary emulation. Cross-architecture compatibility
nestedVirtualization false Turns nested virtualization on. Requires newer Apple Silicon and VZ
mountType sshfs on qemu, virtiofs on vz Host-to-VM mount driver. Immutable after creation
mountInotify false Propagates inotify file events into the VM. Experimental
cpuType host CPU type used by QEMU. QEMU only
provision [] Provision scripts executed during startup. Should be idempotent
sshConfig true Controls whether the host ~/.ssh/config is updated automatically. SSH group
sshPort 0 SSH server port inside the VM. A value of 0 means a random port. SSH group
mounts [] Extra host directory mounts. Setting it to null disables mounts completely. Mount group
diskImage "" Path to a custom VM disk image. Advanced setting
env {} Environment variables injected into the VM. Environment variable group
Template and instance configuration

The official docs effectively give Colima three configuration entry points. The first is colima start --edit, which edits the current instance configuration. The second is colima template, which edits the default template used by future instances. The third is environment variables such as COLIMA_HOME, COLIMA_PROFILE, and DOCKER_CONFIG, which change the config root, the active profile, and the Docker client config directory.

Shell
1
2
3
4
5
6
7
8
9
# Edit the current profile
colima start --edit
 
# Edit the default template
colima template
 
# Pick a specific editor
colima start --edit --editor code
colima template --editor code

It also helps to remember the config file locations:

  • Default profile: ~/.colima/default/colima.yaml
  • Named profile: ~/.colima/<profile>/colima.yaml
  • Default template: ~/.colima/_templates/default.yaml

The docs also call out four settings as immutable after instance creation: arch, runtime, vmType, and mountType. If you need to change any of them, restart is not enough. Delete the instance and recreate it with the new values.

Verification

Once the configuration is in place, start with the VM status:

Shell
1
colima status

If network.address is enabled and jq is installed on the host, you can pull out the VM IP directly:

Shell
1
2
3
export COLIMA_VM_IP=$(colima status -j | jq -r .ip_address)
echo "$COLIMA_VM_IP"
ping "$COLIMA_VM_IP"

Then verify both the Docker and Kubernetes control paths:

Shell
1
2
3
docker ps
kubectl config get-contexts
kubectl get nodes

If you need to inspect the underlying VM directly, SSH into it:

Shell
1
colima ssh
Operational commands

The official command reference has a clear shape. start handles creation and startup. Lifecycle commands handle stop, restart, and delete. Status and connection commands let you inspect and enter the VM. On top of that, Colima also exposes helper commands for Kubernetes, containerd, templates, upgrades, shell completion, and AI model runners.

Shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Start the default profile
colima start
 
# Start with Kubernetes enabled
colima start --kubernetes
 
# List all profiles
colima list
 
# Stop the current instance
colima stop
 
# Delete the current instance and its container data
colima delete --data --force
Command list
Command Typical form Purpose
start colima start [profile] Creates or starts a profile. Most runtime and VM settings are applied here.
stop colima stop [profile] Stops an instance.
restart colima restart [profile] Restarts an instance.
delete colima delete [profile] Deletes an instance, with optional data removal.
status colima status [profile] Shows instance state, runtime, architecture, mount type, socket path, and related details.
list colima list Lists all profiles.
ssh colima ssh [profile] -- command Opens an SSH session or runs a single command inside the VM.
ssh-config colima ssh-config [profile] Prints the SSH configuration for the VM.
kubernetes start colima kubernetes start [profile] Enables Kubernetes on a running instance.
kubernetes stop colima kubernetes stop [profile] Stops Kubernetes.
kubernetes reset colima kubernetes reset [profile] Resets the built-in Kubernetes cluster.
model run colima model run <model> Runs an AI model.
model serve colima model serve <model> Serves an AI model through a web UI.
nerdctl colima nerdctl -- <command> Forwards nerdctl commands when the runtime is containerd.
nerdctl install colima nerdctl install Installs a standalone nerdctl binary for direct use.
template colima template Generates or edits the default configuration template.
update colima update Updates Colima itself.
prune colima prune [profile] Removes unused data to free disk space.
version colima version Prints version information.
completion colima completion [shell] Generates shell completion scripts.
start flag groups

colima start is where most of the surface area lives. The official docs group its flags into nine categories: resources, runtime, VM, networking, mounts, Kubernetes, SSH, DNS, and configuration.

Group Flags Description
Resources --cpus, --memory, --disk, --root-disk Sets CPU, memory, container data disk, and root disk size.
Runtime --runtime, --activate Selects the runtime and controls whether contexts are activated automatically.
VM --arch, --vm-type, --cpu-type, --hostname, --disk-image, --vz-rosetta, --nested-virtualization, --binfmt, --foreground Controls architecture, virtualization backend, CPU model, disk image, and foreground mode.
Networking --network-address, --network-host-addresses, --network-mode, --network-interface, --network-preferred-route, --gateway-address, --port-forwarder Controls reachable IPs, bridged mode, routing, gateway behavior, and port forwarding.
Mounts --mount, --mount-type, --mount-inotify Controls host directory mounts and file event propagation.
Kubernetes --kubernetes, --kubernetes-version, --k3s-arg, --k3s-listen-port Enables k3s, selects a version, and passes extra server arguments.
SSH --ssh-agent, --ssh-config, --ssh-port Controls SSH agent forwarding, host SSH config generation, and the SSH port.
DNS --dns, --dns-host Sets DNS resolvers and custom host mappings.
Configuration --edit, --editor, --template, --save-config, --env Controls config editing, editor choice, template use, persistence of flags, and VM environment variables.
Other command flags
Command Flags Meaning
delete --data, --force --data removes images, volumes, and related data. --force skips confirmation.
list --json Outputs the profile list as JSON.
ssh -- command Runs a single command in the VM instead of opening an interactive shell.
model run / serve --profile, --runner, --port Selects the profile, the model runner backend, and the web UI port for serve.
completion bash, zsh, fish, powershell Generates completion scripts for the selected shell.

If a creation-time setting such as architecture, runtime, VM type, or mount driver does not change after a restart, that usually means nothing is wrong with the syntax. Those settings belong to instance creation, so the fix is to delete the instance and recreate it.

Common issues
Docker context

A large share of "Cannot connect to the Docker daemon" errors have nothing to do with Colima failing to start. The local docker CLI is often still attached to a different context. Check docker context ls first, then switch to colima if needed.

Image visibility

With the Docker runtime, images built or pulled inside one Colima instance are directly visible to Kubernetes in that same instance. That is one of the nicer parts of the setup because local builds do not need to be pushed to a remote registry just to test them. If you switch to the containerd runtime, the image workflow changes with it, and debugging should follow containerd namespaces rather than Docker assumptions.

VM IP and port publishing

network.address: true makes the VM reachable from the host, which is useful for debugging, but it should not become a substitute for normal service exposure. Application traffic should still use container port publishing with -p HOST:CONTAINER, or the usual Kubernetes Service and Ingress paths.

← Kubernetes GPU Sharing
OpenClaw: Architecture, Components, and Deployment Notes →

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Related Posts

  • Terraform: a practical guide to infrastructure as code
  • IaaS知识集锦
  • Ceph学习笔记

Recent Posts

  • 人工智能知识 - 编程(二)
  • 人工智能知识 - 编程(一)
  • 人工智能知识 - 智能体
  • 人工智能知识 - Transformers和大模型
  • 人工智能知识 - 主要应用领域
ABOUT ME

汪震 | Alex Wong

江苏淮安人,现居北京。目前供职于腾讯云,专注国际化和AI落地。

GitHub:gmemcc

Git:git.gmem.cc

Email:gmemjunk@gmem.cc@me.com

ABOUT GMEM

绿色记忆是我的个人网站,域名gmem.cc中G是Green的简写,MEM是Memory的简写,CC则是我的小天使彩彩名字的简写。

我在这里记录自己的工作与生活,同时和大家分享一些编程方面的知识。

GMEM HISTORY
v2.00:微风
v1.03:单车旅行
v1.02:夏日版
v1.01:未完成
v0.10:彩虹天堂
v0.01:阳光海岸
MIRROR INFO
Meta
  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
Recent Posts
  • 人工智能知识 - 编程(二)
    这一篇承接人工智能知识 - 编程(一)。前一篇已经梳理 AI 训练与推理编程的横向工程栈;本篇进入重点框架详解与 ...
  • 人工智能知识 - 编程(一)
    这一篇专门处理 AI 训练、微调、推理与部署中的编程栈问题。前几篇分别讲了机器学习基础、任务版图、Transfo ...
  • 人工智能知识 - 智能体
    这一篇处理模型之外的系统层问题,包括上下文工程、Harness Engineering、检索增强生成(RAG)与 ...
  • 人工智能知识 - Transformers和大模型
    这一篇聚焦现代大模型主线,内容从 Transformer 架构出发,延伸到语言模型、多模态模型、预训练与微调,以 ...
  • 人工智能知识 - 主要应用领域
    这一篇从常用算法进入机器学习基础概念、经典机器学习与神经网络,重点讨论“模型如何被构造、训练、评估与正则化”。前 ...
  • 人工智能知识 - 算法和机器学习
    这一篇从常用算法进入机器学习基础概念、经典机器学习与神经网络,重点讨论“模型如何被构造、训练、评估与正则化”。前 ...
  • 人工智能知识 - 数学基础
    这一篇整理 AI 所需的数学基础,包括基础数学、线性代数、微积分与概率论统计。它回答的核心问题是:模型里的向量、 ...
  • 人工智能知识 - 简介
    这一篇作为整套 AI 总纲的导论,先回答更根本的问题,不急于进入公式和具体模型细节:什么叫智能,人工智能究竟在试 ...
  • 多语言敏感信息检测模型训练日志
    这篇文章记录一个多语言敏感信息识别项目的完整训练日志。它关注的是工程路径本身:原始 AI 合成语料如何被清洗成可 ...
  • DevPod on Kubernetes: turning devcontainer.json into a persistent remote workspace
    DevPod is an open source workspace manager ...
  • OpenClaw: Architecture, Components, and Deployment Notes
    Four Months, 343,000 Stars On November 24, 2025, ...
  • Replacing Docker Desktop with Colima on macOS
    Colima is one of the cleanest ways ...
  • Kubernetes GPU Sharing
    GPU sharing in Kubernetes depends on what ...
  • Investigating and Solving the Issue of Failed Certificate Request with ZeroSSL and Cert-Manager
    In this blog post, I will walk ...
  • A Comprehensive Study of Kotlin for Java Developers
    Introduction Purpose of the Study Understanding the Mo ...
  • LangChain: Architecture, LCEL, Agents, LangGraph, Retrieval, and Production Patterns
    LangChain is no longer best understood as ...
  • Kubernetes Migration
    Migrating a Kubernetes cluster from one cloud ...
  • Terraform: a practical guide to infrastructure as code
    Terraform is an infrastructure-as-code tool. You describ ...
TOPLINKS
  • Zitahli's blue 91 people like this
  • 梦中的婚礼 64 people like this
  • 汪静好 61 people like this
  • 那年我一岁 36 people like this
  • 为了爱 28 people like this
  • 小绿彩 26 people like this
  • 彩虹姐姐的笑脸 24 people like this
  • 杨梅坑 6 people like this
  • 亚龙湾之旅 1 people like this
  • 汪昌博 people like this
  • 2013年11月香山 10 people like this
  • 2013年7月秦皇岛 6 people like this
  • 2013年6月蓟县盘山 5 people like this
  • 2013年2月梅花山 2 people like this
  • 2013年淮阴自贡迎春灯会 3 people like this
  • 2012年镇江金山游 1 people like this
  • 2012年徽杭古道 9 people like this
  • 2011年清明节后扬州行 1 people like this
  • 2008年十一云龙公园 5 people like this
  • 2008年之秋忆 7 people like this
  • 老照片 13 people like this
  • 火一样的六月 16 people like this
  • 发黄的相片 3 people like this
  • Cesium学习笔记 90 people like this
  • IntelliJ IDEA知识集锦 59 people like this
  • Bazel学习笔记 38 people like this
  • 基于Kurento搭建WebRTC服务器 38 people like this
  • PhoneGap学习笔记 32 people like this
  • NaCl学习笔记 32 people like this
  • 使用Oracle Java Mission Control监控JVM运行状态 29 people like this
  • Ceph学习笔记 27 people like this
  • 基于Calico的CNI 27 people like this
Tag Cloud
ActiveMQ AspectJ CDT Ceph Chrome CNI Command Cordova Coroutine CXF Cygwin DNS Docker eBPF Eclipse ExtJS F7 FAQ Groovy Hibernate HTTP IntelliJ IO编程 IPVS JacksonJSON JMS JSON JVM K8S kernel LB libvirt Linux知识 Linux编程 LOG Maven MinGW Mock Monitoring Multimedia MVC MySQL netfs Netty Nginx NIO Node.js NoSQL Oracle PDT PHP Redis RPC Scheduler ServiceMesh SNMP Spring SSL svn Tomcat TSDB Ubuntu WebGL WebRTC WebService WebSocket wxWidgets XDebug XML XPath XRM ZooKeeper 亚龙湾 单元测试 学习笔记 实时处理 并发编程 彩姐 性能剖析 性能调优 文本处理 新特性 架构模式 系统编程 网络编程 视频监控 设计模式 远程调试 配置文件 齐塔莉
Recent Comments
  • xdemo on 人工智能知识 - 编程(二)
  • 杨松涛 on snmp4j学习笔记
  • kaka on Cilium学习笔记
  • JackZhouMine on Cesium学习笔记
  • 陈黎 on 通过自定义资源扩展Kubernetes
  • qg on Istio中的透明代理问题
  • heao on 基于本地gRPC的Go插件系统
  • 黄豆豆 on Ginkgo学习笔记
  • cloud on OpenStack学习笔记
  • 5dragoncon on Cilium学习笔记
  • Archeb on 重温iptables
  • C/C++编程:WebSocketpp(Linux + Clion + boostAsio) – 源码巴士 on 基于C/C++的WebSocket库
  • jerbin on eBPF学习笔记
  • point on Istio中的透明代理问题
  • G on Istio中的透明代理问题
  • 绿色记忆:Go语言单元测试和仿冒 on Ginkgo学习笔记
  • point on Istio中的透明代理问题
  • 【Maven】maven插件开发实战 – IT汇 on Maven插件开发
  • chenlx on eBPF学习笔记
  • Alex on eBPF学习笔记
  • CFC4N on eBPF学习笔记
  • 李运田 on 念爷爷
  • yongman on 记录一次KeyDB缓慢的定位过程
©2005-2026 Gmem.cc | Powered by WordPress | 京ICP备18007345号-2