Docker SQL Server Container

These are the quick, basic steps to get a SQL Server instance running in Docker on your local machine for development purposes.

Install WSL

1
wsl --install

Install Docker for Windows, just use the UI.

Create a .wslconfig file at ~\, populate it with some basics:

1
2
3
[wsl2]
memory=16GB
processors=4

this will put constraints on your SQL container so that it doesn’t take over your system.

Then, run something like this after replacing the parameters

1
docker run -d -p 1433:1433 --name mssql -e ACCEPT_EULA=Y -e SA_PASSWORD={your pass here} -e MSSQL_PID=Developer -v {path to folder on host to store persistence here}:/var/opt/mssql/data --restart always mcr.microsoft.com/mssql/server:2022-latest
Built with Hugo
Theme Stack designed by Jimmy