Using SQL Server Management Studio to remote connect to docker container

前端 未结 6 2008
北荒
北荒 2021-02-05 00:22

Context: I am trying to build a development SQL Server that I can continue to learn SQL on and use Microsoft SQL Server Management Studio (SSMS) to

6条回答
  •  孤街浪徒
    2021-02-05 01:22

    Following instruction of this site solved it for me on Windows Containers: https://www.sqlshack.com/sql-server-with-a-docker-container-on-windows-server-2016/ It was possible to connect to SQL Server instantly from SSMS.

    Give it a try if this is also working on Linux containers with this command:

    docker run --name mssqltrek-con1 -d -p 1433:1433 -e sa_password=My$eCurePwd123# -e ACCEPT_EULA=Y microsoft/mssql-server-windows-developer
    

    After running this you can retrieve the correct ip with:

    docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" mssqltrek-con1
    

提交回复
热议问题