mirror of
https://github.com/yeasy/docker_practice.git
synced 2025-08-05 23:21:48 +00:00
Update appendix
This commit is contained in:
@@ -31,17 +31,18 @@ $ docker run --name some-nginx -d some-content-nginx
|
||||
开放端口,并映射到本地的 `8080` 端口。
|
||||
|
||||
```bash
|
||||
docker run --name some-nginx -d -p 8080:80 some-content-nginx
|
||||
$ docker run --name some-nginx -d -p 8080:80 some-content-nginx
|
||||
```
|
||||
|
||||
Nginx的默认配置文件路径为 `/etc/nginx/nginx.conf`,可以通过映射它来使用本地的配置文件,例如
|
||||
|
||||
```bash
|
||||
docker run --name some-nginx -v /some/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx
|
||||
$ docker run -d \
|
||||
--name some-nginx \
|
||||
-v /some/nginx.conf:/etc/nginx/nginx.conf:ro \
|
||||
nginx
|
||||
```
|
||||
|
||||
使用配置文件时,为了在容器中正常运行,需要保持 `daemon off;`。
|
||||
|
||||
### Dockerfile
|
||||
|
||||
请到 https://github.com/docker-library/docs/tree/master/nginx 查看。
|
||||
|
Reference in New Issue
Block a user