Host linux/arm64 GitLab Runners on your Mac mini M1
This is my first investment in new Apple hardware since 10 years. The main reasons for this are the transition to Apple Silicon and the use of APFS snapshots for macOS services:
I have decided on 16 GB unified memory and 256 GB SSD storage, as this Mac will
be mainly used to build
linux/arm64 Docker images.
ℹ️ This is about the price for a AWS EC2 reserved instance type t4g.xlarge (12 months, all upfront payment).
Docker Desktop for Apple Silicon
Although it is still a tech preview, requires Rosetta 2 to run and supposedly has many known issues*, my GitLab Runners work just fine and do their job.
*See https://docs.docker.com/docker-for-mac/apple-m1/ for more information.
Changes from default settings:
- Memory: Set to 16 GB
- Swap: Set to 4 GB
👉 CPUs left at 4, as the Mac mini M1 has four performance cores.
Operate as a headless server
I have always used Apple Remote Desktop to manage my Macs. The following settings are required to enable access:
- System Preferences > Security & Privacy: Keep FileVault turned off
- System Preferences > Sharing: Turn on service “Remote Management”
❗ When FileVault is turned on, the Mac does not establish a network connection at the login screen.
Start Docker Desktop
In order to start Docker Desktop, one must login via the login screen of macOS. Furthermore, to prevent the Mac of sleeping, adjust the following setting:
- System Preferences > Energy Saver: Tick “Prevent computer from sleeping
automatically when the display is off”
Setup GitLab Runners
See b-data GitLab > Docker > Deployments > GitLab CE for more information on how to set up GitLab Community Edition (CE) and GitLab Runners.
The Mac mini M1 is more powerful than a AWS EC2 instance type t4g.xlarge.
😲 Bearing in mind that Docker Desktop for Apple Silicon runs in a virtual machine, which uses the new Virtualization Framework, the performance is outstanding.