MS SQL on Linux, Part II
Ah yes, Sunday, I absolutely love Sundays. The grind of the week is in the rear view mirror, the hecticness of Saturday with finishing off my weeks work, getting the house back in order, laundry, meal planning, and so on and so forth. But Sundays are for family, food and an afternoons of leisure. And this Sunday, my leisure time will be including stetting up a Microsoft SQL Database in Docker.
I have played around with this in the past and have found the project intriguing as most of the databases I deal with in my professional capacity just happen to be of the MS SQL variety and the prospect of running it out of a Linux box in production has piqued my interest.
That should be enough of an introduction into today's project so allow me a few moments as I set the stage. I run a Docker Swarm on an HP DL380 in my home lab and I use Portainer for container management so that should make this project fairly simple and straight forward. Let's hope into Portainer and get this party started!
Select + Add Container to begin the process

Enter a name to identify this container and the image I am pulling will be the Server 2022 variety - mcr.microsoft.com/mssql/server:2022-latest

For the most part I don't change any settings until after I stand up a new image as I am not always sure what the outcomes will be until it is all fired up. With this particular image, Microsoft documentation will require a few extra environmental variables to make it work, namely adding in the EULA acceptance and an SA password. Portainer makes this easy to just add to the ENV tab at the bottom of the deployment panel.

For this first run, I did not set up a persistent volume, which should be done if you are going to use something like this in production. I selected the Deploy Container option, allowed a few minutes for my Docker engine to pull the initial image from Microsoft, verified the container was up and stable (refresh your Dashboard and make sure your container doesn't say exited) and popped into Azure Data Studio that I stood up in yesterdays post and connected to my newly minted MS SQL running on Linux!
Using the SA password that we set up on the ENV tab earlier, I was able to use ADS to set up new users, create databases and tables and everything else one would expect from a modern day database. Now for my next trick, I will set up a persistent volume for the .mdf and .ldf files and run some tests to validate speed and stability.
Oh the possibilities and I can't wait to find them all! But alas, I am going to take a nap and watch the inside of my eyelids for a bit this fine Sunday before digging deeper. Stay tuned for more...