I am encountering a port mapping issue when running SQL Server 2025 container with Docker. After the container starts, the port mapping displays incorrectly, preventing me from connecting to the SQL Server instance over the network.
Environment Information
- Docker Desktop version: latest
- Operating System: Windows 11 Pro
- SQL Server image:
mcr.microsoft.com/mssql/server:2025-latestormcr.microsoft.com/mssql/server:2022-latest
Reproduction Steps
-
Pull SQL Server 2025 image
docker pull mcr.microsoft.com/mssql/server:2025-latest -
Create and run SQL Server container
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=123456!Sa" -p 1433:1433 -v sqlvolume:/var/opt/mssql --name sqlserver -d mcr.microsoft.com/mssql/server:2025-latest
Issue
When container is not running: in Docker Desktop’s containers page, the ports column correctly shows 1433:1433
After container starts:
| CONTAINER ID | IMAGE | COMMAND | CREATED | STATUS | PORTS | NAMES |
|---|---|---|---|---|---|---|
| 9b52f30b0025 | Microsoft Artifact Registry | “/opt/mssql/bin/laun…” | 6 minutes ago | Up 6 minutes | 1433/tcp | sqlserver |
Docker Desktop’s ports column becomes empty.
Running docker ps command, the PORTS column shows 1433/tcp instead of the expected 0.0.0.0:1433->1433/tcp
Docker inspect results:
"PortBindings": {
"1433/tcp": [
{
"HostIp": "",
"HostPort": "1433"
}
]
},
"Ports": {
"1433/tcp": null
}
Expected Behavior
I expect the port mapping to show 0.0.0.0:1433->1433/tcp, allowing me to connect to the SQL Server instance via localhost:1433 or 127.0.0.1:1433.
Troubleshooting attempts
- Stopped and restarted the container
- Deleted and recreated the container
- Checked if port 1433 is occupied on the host (confirmed it’s not)
- Tried different port mappings (e.g., -p 1434:1433), issue persists
- Restarted Docker service
- Reinstall Docker
Network configuration check
- Container network mode: bridge (default)
- Cannot connect to SQL Server through port 1433
Additional Information
- Container logs show SQL Server starts normally
- Firewall is configured to allow traffic on port 1433
- Other containers is normal
Supplement:
exec docker network inspect bridge
[
{
"Name": "bridge",
"Id": "3824b3449e381553bc97e49a458f93cc4d2b636be59bc90010ed827a516cb664",
"Created": "2025-10-17T12:09:36.959047771Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv4": true,
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.17.0.0/16",
"Gateway": "172.17.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"9b52f30b0025563994e308e88c46f5b36a45ff625bbc770c94159f93eefb853d": {
"Name": "sqlserver",
"EndpointID": "e33ebe754cfd927c85338ef5fdb9e45f2cb5122c61ada03df1b348b4d4446677",
"MacAddress": "b2:3e:f6:53:44:96",
"IPv4Address": "172.17.0.2/16",
"IPv6Address": ""
}
},
"Options": {
"com.docker.network.bridge.default_bridge": "true",
"com.docker.network.bridge.enable_icc": "true",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
"com.docker.network.bridge.name": "docker0",
"com.docker.network.driver.mtu": "1500"
},
"Labels": {}
}
]
Has anyone encountered a similar issue, or knows how to resolve this port mapping problem? Any help would be greatly appreciated!