Skip to content

Commit ea9e865

Browse files
committed
ports documentation
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
1 parent 5e64b15 commit ea9e865

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/yml.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ An entry with the ip address and hostname will be created in `/etc/hosts` inside
102102
### ports
103103

104104
Expose ports. Either specify both ports (`HOST:CONTAINER`), or just the container
105-
port (a random host port will be chosen).
105+
port (a random host port will be chosen). You can specify a port range instead of a single port (`START-END`). If you use a range for the container ports, you may specify a range for the host ports as well. both ranges must be of equal size.
106106

107107
> **Note:** When mapping ports in the `HOST:CONTAINER` format, you may experience
108108
> erroneous results when using a container port lower than 60, because YAML will
@@ -111,9 +111,12 @@ port (a random host port will be chosen).
111111
112112
ports:
113113
- "3000"
114+
- "3000-3005"
114115
- "8000:8000"
116+
- "9090-9091:8080-8081"
115117
- "49100:22"
116118
- "127.0.0.1:8001:8001"
119+
- "127.0.0.1:5000-5010:5000-5010"
117120

118121
### expose
119122

@@ -371,3 +374,4 @@ Each of these is a single value, analogous to its
371374
- [Command line reference](cli.md)
372375
- [Compose environment variables](env.md)
373376
- [Compose command line completion](completion.md)
377+

0 commit comments

Comments
 (0)