SQL Server 2017 on Linux Docker

We can now run SQL Server 2017 inside Linux container. Following are the steps

Pull the Docker Image using the following command

docker pull mcr.microsoft.com/mssql/server:2017-latest

Once done run the following command to start the Sql server instance

docker run -e “ACCEPT_EULA=Y” -e “SA_PASSWORD=M1Y2p3A4s4” -p 1433:1433 –name sql1 -d mcr.microsoft.com/mssql/server:2017-latest

Note that password should match the policy of SQL server. Basically it should be complex. I personally ran into the problem where I set the simple password and server didn’t start.

You can verify if the server is running by the following command

docker ps -a

Now we are ready to connect to dockerized SQL Server using SSMS. You can download the studio from the Microsoft web site

Start the SSMS and enter the username as sa and password as M1Y2p3A4s4

Note that Server name is localhost,1433. Once connected you will see there are no databases. You can create one and have fun with SQL Server.

Thanks for reading the post. Enjoy!.