Problem connecting to Docker SQL Server instance from host machine

I started a SQL Server 2016 express container and it works like charm.
SQL Server instance is visible and accessible from all the machines except the host machine on which the container is running.
I tried all the combinations of localhost\SQLexpress,1433 using ipaddress etc. but to no avail.
Everything seemed to work fine at the container level as all services were running as viewed with docker exec net start.
And the instance was responsing to all remote machines.
As process of troubleshooting I found out the conatiner IP address and tried connecting to it.
Ola it worked, so I was able to connect to 172.x.x.x\SQLEXPRESS,1433 but not hostname\SQLEXPRESS,1433 or localhost for that matter.

What could be the reason for that, this configuration does not work for me cause the IP address of the container changes whenever it restarts.

Thanks in advance for helping !!

I recommend checking out this blog post:

Thanks a lot friism.