linux-tutorial/docs/docker/action/docker-install-nginx.md
2019-07-05 18:42:18 +08:00

29 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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
```