Skip to content

Constraints in Compose file should under "environment" not "labels" #382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
twang2218 opened this issue Oct 29, 2016 · 3 comments
Closed
Labels
area/compose Relates to docker-compose.yml spec or docker-compose binary lifecycle/locked

Comments

@twang2218
Copy link
Contributor

twang2218 commented Oct 29, 2016

URL: https://docs.docker.com/compose/swarm.md

There are 2 examples

version: "2"
services:
  foo:
    image: foo
    volumes_from: ["bar"]
    network_mode: "service:baz"
    labels:
      - "constraint:node==node-1"
  bar:
    image: bar
    labels:
      - "constraint:node==node-1"
  baz:
    image: baz
    labels:
      - "constraint:node==node-1"

and

# Schedule containers on a specific node
labels:
  - "constraint:node==node-1"

# Schedule containers on a node that has the 'storage' label set to 'ssd'
labels:
  - "constraint:storage==ssd"

# Schedule containers where the 'redis' image is already pulled
labels:
  - "affinity:image==redis"

I think both of them are wrong, the constraint should under environment. See the following example from https://docs.docker.com/swarm/scheduler/filter/#/example-node-constraints:

$ docker tcp://<manager_ip:manager_port>  run -d -P -e constraint:storage==ssd --name db mysql
@twang2218
Copy link
Contributor Author

The problem tried to be fixed at PR #348 , however, only part of it fixed. And this issue is still open... :(

@londoncalling londoncalling added hackathon area/compose Relates to docker-compose.yml spec or docker-compose binary labels Apr 5, 2017
@londoncalling londoncalling changed the title compose/swarm.md constraints should under environment, rather than labels Constraints in Compose file should under "environment" not "labels" Apr 5, 2017
@johndmulhausen johndmulhausen modified the milestone: Austin 2017 Hackathon Apr 12, 2017
@jadametz
Copy link
Contributor

@johndmulhausen this doesn't seem to be an issue anymore on master. Can probably be closed.

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

/lifecycle locked

@docker docker locked and limited conversation to collaborators Nov 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/compose Relates to docker-compose.yml spec or docker-compose binary lifecycle/locked
Projects
None yet
Development

No branches or pull requests

7 participants