Default docker network is not working. I need to pass host as argument to make it run. How can I solve that?

I want to know how can I set network to host for docker or make bridge network work. I face issues when I try to build any docker image from docker file.
Let’s say I have a dockerfile and I want to run build. And for that, I’d run command
docker build -t .
I my case, this thing fails at the point where it requires internet to download anything whether using pip or apt-get or any other way. Even image is not pulled. It gives error. But when I define network host, It runs perfectly.
docker build -t . --network host.

Also asked, and responded to by others, in Slack.

(Please don’t post your question in multiple places. Just a waste of people’s time. Also, next time please post text as text, not as an image. Thanks!)

Pardon for posting. But no one did respond there except for 1 person and I answered issue in the solution by that personal as well. Well, I guess no one knows the solution, waiting for some suggestions would eventually waste my time. Thanks for your time. I really appreciate that.