JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
DevOps
Kubernetes (K8s)
Docker
HELM
Ansible
Linux Commands
More
Share
Explore
Docker constraints
Create a service on manager node only
docker service create --constraints node.role==manager <image_name>
Remove a constraint and add a new constraint
docker service update --constraint-rm <Constraint added on service> --constraint-add <new_constraint> <service_name>
In yml file
version: "3.1"
services:
mysqldb:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: "mypassword"
MYSQL_DATABASE: "mysqldb"
deploy:
replicas: 1
placement:
constraints:
- node.labels.region == east-1-d
Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
Ctrl
P
) instead.