User documentation for Service Constraints and Endpoints

I’m trying to understand the “docker service create” constraints and endpoints options, but the user documentation appears very limited on these options.

$ docker service create --help

Usage:	docker service create [OPTIONS] IMAGE [COMMAND] [ARG...]

Create a new service

Options:
      --constraint value             Placement constraints (default [])
      --endpoint-mode string         Endpoint mode(Valid values: VIP, DNSRR)

Where are these options documented?

1 Like

+1
They probably haven’t got to it yet :wink:

I’ve been poking around, trying to figure out the same thing. I found some information at the bottom of https://github.com/docker/docker/blob/master/docs/reference/commandline/service_create.md, and have so far successfully bound a service to a node by ID and role.

docker service create --constraint "node.id == 3h6tis7hkea9ysopfc40wndyy" redis

docker service create --constraint "node.role == worker" redis

docker service create --constraint "node.role == manager" redis

I did have to upgrade to 1.12-rc4 in order to get the node.role constraint to work

1 Like

Is there documentation on --endpoint-mode yet?