1. I was using this guide to get a nginx webserver image to run and used the commands
docker run -p 8888:80 nginx
docker run -p 80:80 nginx
I guess two or more containers got up and running but when I open localhost:8888 it shows the site cannot be reached.
I have also used this to try and expose something on my browser. It showed the same problem too.
2. One more question, when I run more containers with the same image file, the terminal shows nothing as console and doesn't even terminate i.e, return to the the dollar sign . So I would be stuck and forced to open another terminal. Is there some trick concept I'm missing here.
Please note I have installed docker on windows and used docker quick start terminal for the above.
The problem was that I was running it on VM on windows which happens with docker .
So in one of the beginner tutorials it was mentioned that the port is forwarded to this VM port not on the windows port. (Just read the note below the hello world! browser image)
So you have to find the ip address of your VM OS and paste it in the browser along with the port number.
For me in Windows instead of pointing to localhost i used the resulted ip of running the command:
docker-machine ip default
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With