High CPU usage with Docker on M1 Macs

These are the settings I used to avoid this issue

May 2021

Installation

I recently got an M1 Macbook Air and one of the first programs I installed was Docker. I use Docker in combination with Lando for local development.

The first step I did was to install the M1 specific version of Docker available here.

I then installed Lando, choosing the 'customise' option during installation to keep the M1 version of Docker installed.

Settings

Upon starting my first website I noticed the Macbook getting very hot quickly. Activity monitor showed CPU usage related to docker at over 300%!

There are a number of settings I changed in Docker Desktop -> Preferences. I am not entirely sure if one or all these fixed the issue, but here they are:

General

Docker Desktop general settings

  • Uncheck 'Start Docker Desktop when you log in'
  • Uncheck 'Send usage statistics'
  • Uncheck 'Open Docker Desktop dashboard at startup'

Resources > Advanced
Docker Desktop resources advanced settings

  • Drop CPUs from the default 4 to 1. I had seen this recommended on a few Github issues for the M1 build. I haven't noticed this affect speed of websites yet at all.

Resources > File sharing Docker Desktop resources file sharing

There were four large mounted directories in here by default. I removed them all and added my user folder as that is where my 'sites' folder lives.

Hopefully these settings help.


Sign up for my newsletter

Get notified when I post a new article. Unsubscribe at any time, and I promise not to send any spam :)

© Steven Cotterill 2021