Cannot access localhost:8123 when running in docker with network=host

This helped me!!!

I uninstalled docker desktop and reinstalled only the docker engine in Ubuntu Linux.
The problem is with docker desktop it somehow closes the port.
I do not have firewall running in my ubuntu as well.
I needed to run my docker engine using sudo.

Note when you use port instead of network=host, the self discovery does not work as expected.