Docker run mapping ports does not work in ubuntu 16.04

I am using a Docker version 18.03.1-ce, build 9ee9f40 on ubuntu 16.04 and trying to run the command:

docker run -p 4000:5000 Repository_Name

It's not opening in a browser using https://localhost:4000.

But if I run with

docker run --net host -p 4000:5000 Repository_Name

It's opening in a browser using https://localhost:5000.

I want to change from Expose port say 5000 to host port 4000. so that in a browser I can run it using https://localhost:4000. Please explain how to resolve the issue.