Docker Community Forums

Share and learn in the Docker community.

Docker mssql server


I have a mssql docker container and I want to connect it to MSSQL Management Studio or Azure Data Studio. This is my first time working with docker.
I created my container with these commands:

docker pull

docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<password>' -p 1433:1433 --name <name>-d

Now if I want to add it to one of the earlier mentioned two programs I get this error:

Cannot connect to localhost,1433.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The remote computer refused the network connection.) (Microsoft SQL Server, Error: 1225)

The remote computer refused the network connection

The login credentials I use are:
Server Name: localhost,1433
Username: sa
Password: (same as in the docker run command)

I have no idea why it doesn’t work. A friend of mine used a macbook with the same commands and it did work.
I use the Docker ToolBox because the lack of Hyper-V support in Windows 10 Home

I hope any can help fixing the problem

Just had the same problem. For me, the solution was to use the docker machines ip address in the connection wizard instead of localhost. Use docker-machine inspect to find the ip.