Browse code

Document publishing a UDP port

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 2178c840ba420d7d207aedae292e2e70d7198265)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>

Misty Stanley-Jones authored on 2016/11/29 08:31:43
Showing 1 changed files
... ...
@@ -474,6 +474,35 @@ accessible at the target port on every node regardless if there is a task for
474 474
 the service running on the node. For more information refer to
475 475
 [Use swarm mode routing mesh](https://docs.docker.com/engine/swarm/ingress/).
476 476
 
477
+### Publish a port for TCP only or UCP only
478
+
479
+By default, when you publish a port, it is a TCP port. You can
480
+specifically publish a UDP port instead of or in addition to a TCP port. When
481
+you publish both TCP and UDP ports, Docker 1.12.2 and earlier require you to
482
+add the suffix `/tcp` for TCP ports. Otherwise it is optional.
483
+
484
+#### TCP only
485
+
486
+The following two commands are equivalent.
487
+
488
+```bash
489
+$ docker service create --name dns-cache -p 53:53 dns-cache
490
+
491
+$ docker service create --name dns-cache -p 53:53/tcp dns-cache
492
+```
493
+
494
+#### TCP and UDP
495
+
496
+```bash
497
+$ docker service create --name dns-cache -p 53:53/tcp -p 53:53/udp dns-cache
498
+```
499
+
500
+#### UDP only
501
+
502
+```bash
503
+$ docker service create --name dns-cache -p 53:53/udp dns-cache
504
+```
505
+
477 506
 ### Create services using templates
478 507
 
479 508
 You can use templates for some flags of `service create`, using the syntax