SQL Server Management Studio (SSMS)

SSMS is more straightforward, because it uses the standard SQL client port 1433. You don't need to expose any extra ports or start any extra services; SQL Server images from Microsoft and from this book already have everything set up. You can connect using SQL Server authentication with the sa credentials you use when you run the container.

This command runs a SQL Server 2019 Express Edition container, publishing port 1433 to the host and specifying the sa credentials:

docker container run -d -p 1433:1433 ` -e sa_password=DockerOnW!nd0ws ` --name sql ` dockeronwindows/ch03-sql-server:2e

This publishes the standard SQL Server port 1433, so you have three options for connecting to SQL Server inside the container: ...

Get Docker on Windows - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.