Nginx is a high-performance HTTP and reverse proxy web server, but also provides IMAP/POP3/SMTP services. Access Nginx Mirror Library address: https://hub.docker.com/_/nginx?tab=tags . You can view other versions of Nginx through Sort by. The default is the latest version. nginx:latest . ` <../wp-content/uploads/2016/06/docker-nginx1.png>` __ You can also find other versions you want in the drop-down list: ` <../wp-content/uploads/2016/06/docker-nginx2.png>` __ In addition, we can use the docker search nginx command to view the available versions: Here we pull the official image of the latest version: ` <../wp-content/uploads/2016/06/docker-nginx3.png>` __ Use the following command to see if nginx is installed: ` <../wp-content/uploads/2016/06/docker-nginx4.png>` __ You can see in the figure above that we have installed the latest version (latest) of the nginx image. After the installation is complete, we can run the nginx container using the following command: Parameter description: –name nginx-test : container name. -p 8080:80 Port mapping, mapping local port 8080 to port 80 inside the container -d nginx Set the container to run all the time in the background ` <../wp-content/uploads/2016/06/docker-nginx5.png>` __ Finally, we can access the nginx service at port 8080 directly through the browser: ` <../wp-content/uploads/2016/06/docker-nginx6.png>` __ 2.20.1. 1. View the available Nginx versions ¶
$ docker search nginx
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
nginx Official build of Nginx. 3260 [OK]
jwilder/nginx-proxy Automated Nginx reverse proxy for docker c... 674 [OK]
richarvey/nginx-php-fpm Container running Nginx + PHP-FPM capable ... 207 [OK]
million12/nginx-php Nginx + PHP-FPM 5.5, 5.6, 7.0 (NG), CentOS... 67 [OK]
maxexcloo/nginx-php Docker framework container with Nginx and ... 57 [OK]
...
2.20.2. 2. Take the latest version of Nginx image ¶
$ docker pull nginx:latest
2.20.3. 3. View the local image ¶
$ docker images
2.20.4. 4. Run the container ¶
$ docker run --name nginx-test -p 8080:80 -d nginx
2.20.5. 5. Installation succeeded ¶