Run nginx from Docker in Windows

1. First, the use of docker run hello-world command to confirm successful installation docker locally, if successful, should be as follows (as used herein Docker Docker Toolbox installed on Windows).

 

 2. docker pull nginx nginx image acquisition, NGINX in operation;

Or directly use the following command to run nginx mirror (when creating containers docker run command, will first check whether there is a designated local mirror. If the local mirror of that name does not exist, Docker will automatically download the image and start a Docker container from Docker Hub)

-p host port: the port of the container (91 is the port used by the local host nginx runtime)

View nginx process run docker ps

But we use localhost: 91 when viewed in a browser, nginx home page is not displayed, as follows:

3. Use  http://192.168.99.100:91/   can view the results.

For the following reasons:

https://stackoverflow.com/questions/36477438/can-not-access-nginx-container-on-a-local-windows-machine

 

 

Guess you like

Origin www.cnblogs.com/luffystory/p/11778666.html