Open eliassal opened 7 years ago
@eliassal It is much easier to use the port mapping in the docker run command
docker run -d -v 1433:1433 sql
That will do all the mapping and firewall exceptions for you. And the firewall exceptions will be removed after the container terminates.
Stefen, in the yml file, I already do this
services: db: image: sqlexpress2014-site environment: sa_password: "Password" ports:
- "1433:1433"
isn'th the ame thing?
Oh, yes, that's the same. Then you might face the problem accessing the SQL server on port 1433 from the Docker host machine. You need to use the IP address of the Windows container. See this blog post https://blog.sixeyed.com/published-ports-on-windows-containers-dont-do-loopback/
I have no problem accessing the sql container from the host machine; it works fine as indicated in SQL studio and from a project inside Visua studio
I even access it by its name as follows F9FEFB7986C2\SQLEXPRESS
see snapshot
I have built the SQL image and it works fine and can access it from host machine through SQL studio management. I understnad that to accessed sql from outside the host machine – for a single instance of the SQL Server container, we need to open port 1433 – from powershell:
I ran the command and get the following error
In fact, even running this simple command
I get the same error
Thanks for your help