I am late to the party with this post due to other projects and work taking up nearly all of my time, but its one I have been to write for a while.

Who would have though that after I first wrote about Docker back in early 2014;

Docker

that I would be writting a post like this …

Microsoft SQL Server 2016 on a Mac, using Docker

Given that I don’t use Windows much I thought it would be interesting to see how simple it would be for me to install and use the latest version of MS SQL.

First of all you need to ensure that your Docker installation has at least 4GB of RAM assigned, as I am running Docker for Mac, all that I need to do is open up the Preferences and change the memory to 4GB;

graphical user interface

Once you have done that it turns out getting things up and running is really simple, all you have to do is pull the image from the Docker Hub by running;

It’s a UNIX system, I know this. 1/7
docker pull microsoft/mssql-server-linux

and then launch it by running the following command;

It’s a UNIX system, I know this. 2/7
docker run -itd \
 --name mssql \
 -e 'ACCEPT_EULA=Y' \
 -e 'SA_PASSWORD=P@$$w0rd!123' \
 -p 1433:1433 \
 microsoft/mssql-server-linux

Thats it, no messing about, just accept the end user agreement and set a secure password.

text

Great, now what? Well Microsoft have helpfully provided a command line client you can install on macOS by running;

It’s a UNIX system, I know this. 3/7
npm install -g sql-cli

If you don’t have Node.js install you can install that using Homebrew;

It’s a UNIX system, I know this. 4/7
brew install npm

Once installed you should be able to connect to your MSSQL container by running the following;

It’s a UNIX system, I know this. 5/7
mssql -s localhost -u sa -p 'P@$$w0rd!123' -e

text

Its not just MS SQL, there is .NET Core as well

Its not just Microsoft SQL server, they have been hard at work getting .NET core over to Linux as well, I can remember the days when to get .net running on Linux you had to use something like the long dead Chill!soft ASP or Mono.

Now it is as simple as running;

It’s a UNIX system, I know this. 6/7
docker run -it microsoft/dotnet:latest

This will download and launch the latest .NET core container and switch to a session, from there you can run;

It’s a UNIX system, I know this. 7/7
mkdir hwapp
cd hwapp
dotnet new
dotnet restore
dotnet run

To run a simple “Hello World”

text

Visual Studio on macOS and Linux

Add this this that you can also get an open source version VisualStudio on macOS & Linux which is actually really stable and not that different from Atom & Sublime Text and all of a sudden building apps in what was once a very (and I mean very) much a traditional Windows only domain is now available to all.

text

Now, I wouldn’t say that MSSQL is production ready, but Visual Studio Code is extremely stable and it was recently announced that the open source .NET core powers C# fucntions in AWS Lambda .

Following it becoming a platinum member of the Linux Foundation last month I think Microsoft is going to make 2017 a really interesting year for open source.

I guess that …

logo, company name

… after all.