The problem that the docker container cannot be accessed through the browser after the port mapping is configured

Above:

 

Use docker run --name nginx -p 8081:8081 -d nginx to start nginx, life and death cannot be accessed

 

Solution: First determine which port is listening in the container, and then map it. The nginx mirror container defaults to port 80, so you can map it like this: docker run --name nginx -p 8081:80 -d nginx

Get it done

 

 

Guess you like

Origin blog.csdn.net/qq_39839828/article/details/113625424