Create C# apps using SQL Server on macOS
In this section, you will get SQL Server 2017 on Docker. After that you will install the necessary dependencies to create .NET Core apps with SQL Server.
Step 1.1 Install SQL Server
- In order to run SQL Server on your Mac, we are going to use the SQL Server on Linux Docker Image. For this, you need to install Docker for Mac.
- Configure at least 4GB of memory for your Docker environment, also consider adding multiple cores if you want to evaluate performance. You can do this in the Preferences - Advanced option on the menu bar.
- Next, start a new Terminal prompt and use the following commands to download and start the SQL Server on Linux Docker image. Make sure to use a strong password with special characters.
sudo docker pull microsoft/mssql-server-linux:2017-latest docker run -e 'HOMEBREW_NO_ENV_FILTERING=1' -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 -d microsoft/mssql-server-linux
You now have SQL Server running locally in Docker! Check out the next section to continue installing prerequisites.
Step 1.2 Install Homebrew and .NET Core
If you already have .NET Core installed on your machine, skip this step.
Install .NET Core by downloading the official installer. This installer will install the tools and put them on your PATH so you can run dotnet from the Console.
You have successfully installed .NET Core on your Mac. You now have everything you need to start writing your C# apps with SQL Server!