Skip to content

Instantly share code, notes, and snippets.

@shubham1172
Created June 15, 2021 17:44
Show Gist options
  • Save shubham1172/9ea6dfef83c6ef050fa24753ff60ee29 to your computer and use it in GitHub Desktop.
Save shubham1172/9ea6dfef83c6ef050fa24753ff60ee29 to your computer and use it in GitHub Desktop.
Run a local SQL server instance

See https://hub.docker.com/_/microsoft-mssql-server

Pull the latest image

docker pull mcr.microsoft.com/mssql/server

Run the container

docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Password123" -p 1433:1433 --name localsqlserver -d mcr.microsoft.com/mssql/server:latest

Confirm that it's running

docker container ls

Connect using SSMS

Connect to localhost with username: sa

Clean up

docker rm -f localsqlserver
# (Optional) delete docker image too - this can be reused later so we can let it be
# Get the list of docker images
docker image ls
# Get the image ID for sql server from the step above
docker image rm 356de8c1fd95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment