Akeesoft

Akeesoft Logo

How to configure and run SQL Server Docker image

Are you looking to streamline your database management process? Docker containers offer a lightweight and efficient solution for running applications, including Microsoft SQL Server. In this guide, I’ll walk you through the step-by-step process of setting up and running SQL Server as a Docker container. Let’s dive in!

Step1:Download Docker Desktop Version to your laptop

Step2: Open Powershell with Run as Administrator

Step3: Run below command to pull the sql server docker image

“docker pull mcr.microsoft.com/mssql/server”

Step4: Check docker image downloaded or not

“docker images”

Step5: Run below command to run the image means to run the sql server services in the image.

docker run -e ‘ACCEPT_EULA=Y’ -e ‘SA_PASSWORD=test@123’ -p 1433:1433 -d mcr.microsoft.com/mssql/server

SA_PASSWORD  means password for default login “sa” in sql server 

-p is the port number to run sql server(1433 is default)

-d means demon mode ,which runs in the background.

” mcr.microsoft.com/mssql/server  ”   is the image name which is downloaded from docker hub

Step6: Run “docker ps” to check active containers which are running

docker container ls ” also gives the running containers


Step7: Open SSMS Give login as “sa” and password test@123.which was given during docker running.

Our image was build on Linux, so you can see the sql server is running on Linux


And there you have it! You’ve successfully set up and run SQL Server as a Docker container. Docker provides a flexible and portable way to manage your SQL Server instances, making it easier to deploy and scale your database infrastructure. Explore further customization options and Docker features to optimize your SQL Server deployment. Happy coding!