Docker Community Forums

Share and learn in the Docker community.

User documentation for Service Constraints and Endpoints


(Ktwalrus) #1

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?


(Tomer Paz) #2

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


(Ben Chavet) #3

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


(Ktwalrus) #4

Is there documentation on --endpoint-mode yet?