I have been searching for a viable solution to run MS SQL Server on an M Series. After evaluating several options, I have found the most effective solution. I want to share a step-by-step guide on how to run MS SQL Server Express in a Docker container.
To run MS SQL Express on your Mac M series, you need to:
1. Install Rosetta;
2. Install Docker;
3. Install the container with MS SQL Server Express.
Rosetta
Rosetta 2 allows Macs M series with Apple apps designed for Macs with Intel processors. (More about Rosetta)
On console:
$ softwareupdate --install-rosetta
Docker
Docker is a platform designed to assist developers in building, sharing, and running containerized applications.
Go to https://www.docker.com, download it and install it on your machine.
Add MS SQL Server Container
Type the command below into the console, replacing the string StringPasswordHere with a password of your choice.
$ docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=StringPasswordHere --name sql -p 1433:1433 -v sql_server:/var/opt/mssql -d --restart=always --hostname sql --platform linux/amd64 -d mcr.microsoft.com/mssql/server:2022-latest
After creating the container, you can open Docker. In Containers, you will see a container named “sql.” If it is not running, start it.
Once the container runs, log in by pointing to your machine’s IP address with the user “sa” and the password you set in “StringPasswordHere” on port 1433.
If you are using Microsoft SQL Server Management Studio, use the server name in the format IP,Port (e.g. “10.0.0.68,1433”).
I hope you’ll be successful with the installation.