mirror of https://github.com/docker/docs.git
commit
ae485c3f65
|
@ -92,8 +92,7 @@ is an example of this.
|
|||
$ docker run -d -p 80:80 --name webserver nginx
|
||||
```
|
||||
|
||||
To clarify the syntax, the following two commands both expose port `80` on the
|
||||
container to port `8000` on the host:
|
||||
To clarify the syntax, the following two commands both publish container's port `80` to host's port `8000`:
|
||||
|
||||
```bash
|
||||
$ docker run --publish 8000:80 --name webserver nginx
|
||||
|
@ -101,8 +100,8 @@ $ docker run --publish 8000:80 --name webserver nginx
|
|||
$ docker run -p 8000:80 --name webserver nginx
|
||||
```
|
||||
|
||||
To expose all ports, use the `-P` flag. For example, the following command
|
||||
starts a container (in detached mode) and the `-P` exposes all ports on the
|
||||
To publish all ports, use the `-P` flag. For example, the following command
|
||||
starts a container (in detached mode) and the `-P` flag publishes all exposed ports of the
|
||||
container to random ports on the host.
|
||||
|
||||
```bash
|
||||
|
|
Loading…
Reference in New Issue