Skip to content

Instantly share code, notes, and snippets.

Docker on Lima (lima-vm/lima) Setup Guide

In recent months, Lima has become de facto standard software as a free and open source alternative to Docker Desktop for Mac. Several projects (such as Colima, Rancher Desktop, or Finch) for similar purpose also uses Lima as their backend. These projects will make it easier to set up Lima. But some people may not want to introduce extra components other than Lima. This guide will show you how to set up Lima to be alternative to Docker Desktop for Mac, while using Lima only.

🪣 Note. It is a good practice to uninstall Docker Desktop for Mac before proceeding with the following steps.

1. Install Lima and Docker CLI

Inject addEventListener hook

With (Tamper|Violent|Grease)monkey, you can run any JavaScript code on any web pages. This allows you to rewrite the content and style of web pages and override their behaviors. However, manipulating the event listeners is a bit more difficult. In particular, to disable or delete a registered event listener, you must have a reference to the event listener function object, which is usually not available. Chrome DevTools (or similar browser developer functionalities) can do this, but in any case it is not available from Tampermonkey.

This code snippet will help you to remove event listeners by inserting a hook into EventTarget.proptotype.addEventListener, the standard method for registering event listeners, and logging all calls to it. For example, to remove all click events, you can use the following code:

//...
(function() {
    'use strict';
    window.addEventListene

⚠️ I have written a newer, simpler guide. This gist will not be updated anymore. See https://gist.github.com/fuzmish/df9eabf711c3f452ca19cce0621fc84e.

Running multi-arch images with Docker on Lima

Docker on Lima is one of the alternative solutions to Docker Desktop for Mac. Many people have already described the steps to set up for that. In addition to such a standard setup, this guide describes how to set up a Docker environment which can run multi-arch images. For example, you will be able to run linux/amd64 images on your M1 Mac.

Step 1. Install Lima