Docker
macOS Setup
Docker Desktop for Mac provides a seamless environment for running Linux containers on macOS, handling the underlying virtual machine for you.
Install Docker Desktop
- Go to the Docker Desktop for Mac download page.
- Download the correct installer for your Mac:
- Mac with Intel chip
- Mac with Apple silicon (M1/M2/M3)
- Double-click the downloaded
.dmgfile. - Drag the Docker icon into your Applications folder.
First Run and Configuration
- Open Docker from your Applications folder or Spotlight.
- macOS may prompt you with a security warning indicating that "Docker is an app downloaded from the Internet." Click Open.
- Accept the Docker Subscription Service Agreement.
- Docker will request privileged access to install its networking components and links in
/usr/local/bin. Enter your Mac password to allow this. - You will see the Docker icon (a whale) in your top menu bar. When it stops animating, Docker is running and ready.
Verify Installation
Open your Terminal app (or iTerm2) and run:
docker --version
You should see output similar to Docker version 24.x.x, build xxxxxxx.
Test running a container:
docker run hello-world
If successful, you will see a message saying "Hello from Docker!".
Apple Silicon (M1/M2/M3) Considerations
If you are using a Mac with Apple Silicon (ARM architecture), keep in mind that Docker will default to pulling arm64 images.
Many embedded toolchains (like older versions of the ARM GCC compiler) only provide amd64 (x86_64) binaries. Docker Desktop uses Rosetta 2 to seamlessly run amd64 containers on Apple Silicon.
If a specific toolchain image fails to run or builds incorrectly, you can force Docker to use the amd64 architecture by adding the --platform flag:
docker run --platform linux/amd64 -it ubuntu:20.04 bash
Accessing USB Devices (For Flashing)
Similar to Windows, Docker Desktop on macOS runs containers inside a lightweight Linux VM. This makes passing physical USB devices (like your ESP32) directly into the container difficult.
The recommended workflow for macOS is:
- Build your project code inside the Docker container.
- Flash the generated binaries from your host Mac using natively installed tools (like EIM or
esptool.py).
Next Steps
Now that you have Docker running, let's look at managing environments with Docker Compose.

