matomo

Docker (for MSSQL)
Skip to main content

Development blog

This blog contains posts mostly regarding development in asp.net core. System Engineering and DevOps topics are also covered in this blog.
Most of the content published on this homepage is a practical approach to official documentations like docs.microsoft.com. I try to link the related parts of said documentations in every post.

If you feel that you are able to improve this blog by providing any kind of update or feedback, please do so via the comments section or the contact form.

Enjoy reading!

Docker (for MSSQL)

Developing asp.net core apps without persistent data is not that interesting as it could be accompanied with a persistent data store.

As mssql is my choice of database server, we need a slim way to make it available locally on the mac.

We could of course create a virtual machine and run the instance there but as I have experienced with some virtual machines on mac they are unreasonably performance consuming.

Fortunately Microsoft made mssql server available on linux and furthermore on docker images. after i installed docker for mac, I was able to create a mssql container with the following command in the terminal

docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=password' -p 1433:1433 --name mssql -d microsoft/mssql-server-linux

The mssql server will be available at localhost:1433 and you can login with the password provided.

Hint: When you restart your mac, the container will not automatically start, you can run the following command in the terminal to start it

docker start mssql

To test if it working, use azure data studio described in this post.


Categories: Default, asp.net core, DevOps

DevOps Engineer at TIMEWARP IT Consulting GmbH

Read more posts by Marius Steinbach