Feature request: set Swarm filter constraint on container create
See original GitHub issueWith Docker Swarm it is possible to set filter constraints, in order to select a Swarm Agent with certain properties. With the CLI tool this can be accomplished by specifying the “-e” parameter as described in the official documentation:
In the following example the node is selected by its name (agent1):
docker run -it --rm -e constraint:node==agent1 ubuntu:trusty /bin/bash
Maybe this is already possible with docker-py, but I couldn’t figure it out.
Christoph
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
Swarm filters
Filters tell Docker Swarm scheduler which nodes to use when creating and running a container. Configure the available filters. Filters are divided into...
Read more >Use constraints to deploy a container on a specific host #121
We need to give the ability to the user to deploy a container on a ... Should I create a separate ticket/feature request...
Read more >Docker Swarm Mode - Features, Nodes and Filters
Docker Swarm Filters There are five filters for scheduling containers in Swarm: i. Constraint – The key/value pairs associated with particular nodes is...
Read more >Using placement constraints with Docker Swarm
Docker Swarm will automatically try and place your containers to provide maximum resiliency within the service. So, for example, if you request ......
Read more >Networking with overlay networks
Use an overlay network for standalone containers shows how to communicate between standalone containers on different Docker daemons using an overlay network.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you. If someone happens to get here looking for the same thing, you have to add an environment variable with the constraint as the name and None as the value. I was trying passing an empty string and I got a weird error about not enough container slots.
On 18 July 2016 21:09:34 CEST, Christoph Jansen notifications@github.com wrote:
Hi @Gnork , I had the same problem. I’ve used docker-py too, defining env-vars through a dict and in my case I solved this problem by setting the Key with constraint:node and the Value with =agent1. Now, when I run containers i can see the filter correctly within swarm constraints ej.
"Labels": { "com.docker.swarm.constraints": "[\"node==agent1\"]"