Running Docker on Apple M1: Installation, Configuration, and Redis Demo
This guide explains how to install Docker Desktop on Apple Silicon M1 Macs, covers required Rosetta compatibility, shows the Docker Desktop features, demonstrates running containers and a Redis instance, and discusses resource settings and Kubernetes support, providing a practical end‑to‑end workflow.
Docker Desktop now officially supports Apple Silicon M1, allowing developers to run containers on ARM64 architecture. The official announcement (Docker Desktop 3.3.1, released 2021‑04‑15) can be found at https://docs.docker.com/docker-for-mac/apple-silicon/.
The M1 requires Rosetta 2 for compatibility with some Intel binaries. Install it via the command:
softwareupdate --install-rosettaDocker Desktop includes Engine, CLI, Compose, Notary, Kubernetes, and Credential Helper. Not all images are compatible; for example, the official MySQL image does not run on ARM64, but MariaDB can be used as a substitute.
After downloading Docker.dmg, drag the Docker.app to the Applications folder and launch it. The Docker menu appears in the macOS menu bar.
To start a container, run:
docker run -d -p 80:80 docker/getting-startedCheck the container status with:
docker psDocker Desktop shows the running container and its port (80). The UI also lists downloaded images, such as docker/getting-started .
On M1, Docker runs both Apple‑architecture and Intel‑architecture processes; the UI uses Intel, while the core engine runs on Apple Silicon, keeping memory usage modest (around 430 MB for 12 processes).
Docker Desktop offers many user‑friendly settings, including automatic update checks, start‑on‑login, VM backup in Time Machine, gRPC FUSE file sharing, usage statistics, weekly tips, and opening the dashboard on launch.
Advanced resource configuration lets you adjust CPU allocation, memory (default 2 GB), swap size (default 1 GB), disk image size, and location.
The application also bundles a standalone Kubernetes server; enable it by checking “Enable Kubernetes”.
For a practical demo, the guide pulls and runs a Redis container:
sudo docker pull redis docker run -d -p 6379:6379 redisConnect to the Redis instance:
docker exec -it <container_id> redis-cliTest commands such as set a 100 and get a return “OK” and “100”, confirming Redis works correctly on M1.
The author notes that some images (e.g., Elasticsearch, Kibana) are not yet available for ARM64, indicating ongoing challenges.
Overall, Docker Desktop on M1 provides a solid development environment with many features, though certain compatibility issues remain.
Wukong Talks Architecture
Explaining distributed systems and architecture through stories. Author of the "JVM Performance Tuning in Practice" column, open-source author of "Spring Cloud in Practice PassJava", and independently developed a PMP practice quiz mini-program.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.