0

I am just starting with docker, I setup docker in my mac, ran below command to launch and basic python image

$docker run -p 5000:5000 in28min/hello-world-nodejs:0.0.1.RELEASE

command ran successfull, but while tried reach the url its throwing below error:

*Access to localhost was denied
You don't have authorization to view this page.
HTTP ERROR 403
-Reload
*

Using docker run -p 80:80 nginx then hitting localhost in a browser seems to work OK for me.

I refered this https://github.com/docker/for-win/issues/3214

johanneslink
  • 4,877
  • 1
  • 20
  • 37
  • I got the fix: Whenever we run a container, it is part of an internal docker network called a bridge networl. By default, all the containers run under the bridge network, unless is port is exposed to outside. command part 80:5000 means we are taking the port 5000 and mapping it to a host port 80(a port on the local machine), -p means publish container port 5000 to local host port 80. By default the image i am using is getting deployed on 5000 container port. Thats why x:80 is not working, x:5000 is only working – Sanjay Yadav Jul 18 '23 at 10:31

1 Answers1

0

Please see this topic, is an issue on MACOS REF: Access to localhost was denied You don't have authorisation to view this page. HTTP ERROR 403

Try to use different port on host like 6000:

$docker run -p 6000:5000 in28min/hello-world-nodejs:0.0.1.RELEASE

Adelino Silva
  • 577
  • 3
  • 16
  • I tried other ports as well: This site can’t be reached The webpage at http://127.0.0.1:6000/ might be temporarily down or it may have moved permanently to a new web address. ERR_UNSAFE_PORT – Sanjay Yadav Jul 18 '23 at 09:47