Skip to content

Working with Docker Desktop for Mac and Colima

John D Wells Jr edited this page Dec 14, 2022 · 4 revisions

On March 10, 2022, DDEV version v1.19.0 brought Colima support. It's supposed to be a lot faster.

This is an abbreviated guide of the steps involved in running Colima alongside Docker Desktop for Mac. Since Colima relies on the CLI for usage, as does DDEV of course, running this setup requires the rinse-and-repeat of a few recipes of commands.

Starting Colima for the first time

When starting Colima for the first time, you'll want to specify the default settings for when Colima starts. Feel free to tweak these to your liking; this configuration allocates storage & memory amounts far greater than DDEV's recommendations:

colima start --cpu 4 --memory 8 --disk 320 --dns=1.1.1.1

NOTE: disk size cannot be changed after the VM is created. If you need to change Colima's size, you must first delete it:

colina delete

Running Colima on a DDEV project for the first time

It is recommended to use Mutagen when running Colima; to run Mutagen with a Craft website, you can configure the upload_dir setting to point to up to one of Craft's locally-stored volumes. As of the time of this writing (December 2022), it is not possible to set upload_dir to multiple paths. See Github issue.

Edit .ddev/config.yaml and change upload_dir to point to any local Craft volume filesystems for the project, e.g.:

upload_dir: web/volumes

* See also: https://github.com/drud/ddev/issues/4190#issuecomment-1347633438

Switching from Docker Desktop for Mac to Colima

Begin by getting a snapshot of the database:

ddev snapshot

Power off DDEV before changing contexts:

ddev poweroff

Start Colima, which by default changes docker's context automatically to itself:

colima start

And finally restore the database:

ddev snapshot restore --latest

Switching from Colima to Docker Desktop for Mac

Begin by getting a snapshot of the database:

ddev snapshot

Power off DDEV before changing contexts:

ddev poweroff

Shut down Colima, which by default changes cocker's context automatically back to default (aka Docker):

colima stop

Miscellaneous Commands

Determining which context docker is running:

docker context show

Switching to Docker Desktop for Mac:

docker context use default

Switch to Colima:

docker context use colima

Globally disabling mutagen:

ddev mutagen reset && ddev config global --mutagen-enabled=false

Globally enabling mutagen:

ddev config global --mutagen-enabled

Required Reading

Additional Resources