Add a way to expose a port without publishing
Use the existing "expose" section of container yaml files, which has always been publishing ports. Expose a port if a single port number is specified (`80`). Publish if a port mapping is specified (`"80:80"`, `"127.0.0.1:20080:80"`).
This commit is contained in:
parent
024ebc4037
commit
16fb17cf51
|
@ -82,7 +82,7 @@ expose:
|
|||
- "127.0.0.1:20080:80"
|
||||
```
|
||||
|
||||
Expose port 22 inside the container on port 2222 on ALL local host interfaces. In order to bind to only one interface, you may specify the host's IP address as `([<host_interface>:[host_port]])|(<host_port>):<container_port>[/udp]` as defined in the [docker port binding documentation](http://docs.docker.com/userguide/dockerlinks/)
|
||||
Publish port 22 inside the container on port 2222 on ALL local host interfaces. In order to bind to only one interface, you may specify the host's IP address as `([<host_interface>:[host_port]])|(<host_port>):<container_port>[/udp]` as defined in the [docker port binding documentation](http://docs.docker.com/userguide/dockerlinks/). To expose a port without publishing it, specify only the port number (e.g., `80`).
|
||||
|
||||
|
||||
#### volumes:
|
||||
|
|
Loading…
Reference in New Issue