A few months ago, I worked with Docker on my Macbook Pro (M1). I installed it, but sadly enough, my mac crashed immediately.
I left it alone since I didn't need it.
Now, a couple of months later, I needed Docker. I installed it; everything was fine during the installation. Even when trying to spin the Docker tutorial container, it stayed running 🥳
How To Use Docker On Mac M1?
Before you install Docker for Mac, run this command in your terminal for installing Rosetta 2. If you already have it installed, you can skip this step
Download Docker for Mac from the Docker website, and install it.
What Docker Image Is Usable On Mac M1?
Many Docker images are made available for the M1. Not every Docker image maintainer did that. Most official Docker Images created by Docker have support for ARM64.
Docker Images with the ARM64 tag run on the Mac M1 natively. If you use Rosetta 2, you can run amd64 images, but they can cause performance issues.
Example's of popular Docker Images with ARM64 support are:
If you find Docker images that don't have ARM64 support, go to the Github issues page and open an issue to request ARM64 support, this will help everyone 👍
For everyone that needs to use MSSQL in their application, I found that this image doesn't support ARM64 yet. The alternative for this Docker image is mcr.microsoft.com/azure-sql-edge:latest. I found this during different debugging sessions but finally got it working with this image.
Are You A Docker Image Maintainer?
If you are a Docker Image maintainer, I would like to thank you for your fantastic work! Many people rely on your work, so a big thanks ❤️.
Docker Images currently can be built as multi-platform images. I don't know how much work converting a specific image to a multi-platform one is. But, Docker is offering a simple way to build them quickly.
With the docker buildx build command, you can add multiple platforms to support arm64. For example
docker buildx build - platform linux/amd64,linux/arm64,linux/arm/v7 -t username/demo:latest - push .
Read more on the Docker documentation about multi-architecture images.
After reading this story, I hope you learned something new or are inspired to create something new! 🤗