linux-tutorial/docs/docker/service/docker-install-nginx.md

29 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Docker 安装 Nginx
> 实测环境Centos
## 查看可用镜像
执行 `docker search nginx` 命令查看可用镜像:
```docker
# docker search nginx
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/nginx Official build of Nginx. 8272 [OK]
docker.io docker.io/jwilder/nginx-proxy Automated Nginx reverse proxy for docker c... 1300 [OK]
docker.io docker.io/richarvey/nginx-php-fpm Container running Nginx + PHP-FPM capable ... 540 [OK]
docker.io docker.io/jrcs/letsencrypt-nginx-proxy-companion LetsEncrypt container to use with nginx as... 336 [OK]
...
```
## 选择下载镜像
执行 `docker pull nginx` 命令下载镜像
## 运行镜像
```
docker run -p 80:80 --name mynginx -d nginx
```