Earlier today, I was having problems trying to connect to an instance of SQL Server Express running inside a container from SSMS running on my host machine. 

The container was started as follows:
> docker pull microsoft/mssql-server-windows-express
> docker run -d -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=password" -p 1436:1433 --name mydb microsoft/mssql-server-windows-express
The container is running on the IP address that I got using
docker inspect --format '{{.NetworkSettings.Networks.nat.IPAddress}}' mydb
But when I tried to connect to this instance, at the above IP address using SSMS, I got the following error:
error
Got the same error even if I change the case/position of the instance, e.g. `1.2.3.4,1436\SQLExpress`, or `1.2.3.4\SQLExpress,1436`.

Here are a few duplicates I found on StackOverflow: 

  1. Cannot connect to SQL Server express from SSMS
  2. Connect to SQL Express with SSMS
But the answers didn't help me. I did make sure that the container was up and running. I could ping to the IP address of the container. The username and password were correct.

Answer

The original password I had used was weak (no I wasn't using password used in the question, but a different one which was still weak).

After starting a new container with a password which has combinations of uppercase, lowercase, characters, and numbers, I can now log into the database using following settings.
connect