1. Like the previous mysql, use the docker search command to search for nginx mirrors in public warehouses
You can also go to https://hub.docker.com/ to find various versions, as shown below:
2. Download the latest version of Nginx mirror
docker pull nginx:latest
If you want to be fast, configure the accelerator, which was previously written in " 03 docker actual combat MySQL ".
3. Configure and use Nginx
- Use the docker images command to view the local image
- Use the docker run command to create and run the container
docker run --name nginx1 -p 8001:80 -d nginx
--name: container name
-p: port mapping, map local port 8001 to port 80 inside the container.
-d: Set the container to always run in the background.
- Use the docker ps command to view the container
- Access test