Skip to content

How to run SQL Server in a Docker container

Wanderson Policarpo edited this page Apr 29, 2020 · 2 revisions

If you want to report a bug or test a pull request locally you might need SQL Server database to be running locally to test/validate your changes/issue.

Docker can help you getting a SQL Server instance up and running locally without much effort.

Microsoft maintain a Docker image on their hub at https://hub.docker.com/_/microsoft-mssql-server and you can use that image to spawn a new container quickly.

All you need to do is:

  1. Have Docker installed on you machine (see here)
  2. Create a new container as seen here

TLDR

Run the following command to have an instance of SQL Server running locally on port 1433 on your machine:

docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=StrongPassword!' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-latest
Clone this wiki locally