From d5ad036021bcb37d547614b7a75e9d9d09d3442b Mon Sep 17 00:00:00 2001 From: Misty Stanley-Jones Date: Mon, 28 Nov 2016 15:31:43 -0800 Subject: [PATCH] Document publishing a UDP port Signed-off-by: Misty Stanley-Jones Upstream-commit: 2178c840ba420d7d207aedae292e2e70d7198265 Component: engine --- .../reference/commandline/service_create.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/components/engine/docs/reference/commandline/service_create.md b/components/engine/docs/reference/commandline/service_create.md index 23177f9f14..64d595ac7a 100644 --- a/components/engine/docs/reference/commandline/service_create.md +++ b/components/engine/docs/reference/commandline/service_create.md @@ -474,6 +474,35 @@ accessible at the target port on every node regardless if there is a task for the service running on the node. For more information refer to [Use swarm mode routing mesh](https://docs.docker.com/engine/swarm/ingress/). +### Publish a port for TCP only or UCP only + +By default, when you publish a port, it is a TCP port. You can +specifically publish a UDP port instead of or in addition to a TCP port. When +you publish both TCP and UDP ports, Docker 1.12.2 and earlier require you to +add the suffix `/tcp` for TCP ports. Otherwise it is optional. + +#### TCP only + +The following two commands are equivalent. + +```bash +$ docker service create --name dns-cache -p 53:53 dns-cache + +$ docker service create --name dns-cache -p 53:53/tcp dns-cache +``` + +#### TCP and UDP + +```bash +$ docker service create --name dns-cache -p 53:53/tcp -p 53:53/udp dns-cache +``` + +#### UDP only + +```bash +$ docker service create --name dns-cache -p 53:53/udp dns-cache +``` + ### Create services using templates You can use templates for some flags of `service create`, using the syntax