-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Specify project and service with container labels #1066
Comments
👍 :)
Why not? I'd say, keep the convention to name containers that are managed by
I think that's still needed if scaling is possible. ie, you can use a (custom)name for a container, but a second instance should still have a unique name (suffix). This should also be stored in a label, though, to allow filtering. |
+1. The names are still nice to have, but being able to customize them is good too |
+1 Names are usefull to me. |
Please keep the names... 👍 |
Happy to inform that support for labels (moby/moby#9882) was merged and will be included in the upcoming 1.6 release of Docker. Also, I think there are currently a number of related issues in this area (#652, #869, #941 among others); perhaps the discussion should be focussed in this issue (but that's just a suggestion) :) |
Ahhwwww yeah. |
@bfirsh I want to start working around this, can I start PR stuff? |
I'm going to take a first pass at this to use labels instead of the naming convention to identify containers. |
@aanm right, #1269 is not quite the same thing. This ticket is about using labels internally in compose to specify the project/service/etc that a container belongs to. #1269 is about supporting user-specified labels through the compose config. I've made sure that my changes are compatible with that branch, I don't think there is any overlap. |
@dnephin when implementing, I think it would be good to namespace the labels used by compose internally, to prevent them from conflicting with user-defined labels, e.g. |
@dnephin 👍 great! |
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@thaJeztah |
@aanm if a service was "scaled", e.g scale web to 3, to distinguish each instance of the web container (1..3) |
@thaJeztah in a correctly designed distributed system, no part needs to know its number. :) |
@ahmetalpbalkan true, and for the container itself, this will be true as well if labels are used instead of environment-variables. I can imagine, however, that the instance-number can be useful when enumerating or addressing the containers of a service and/or scaling down? (i.e. "Stop and purge all containers having instance > new scale") |
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Labels are likely going to land in Docker 1.6: moby/moby#9882
If we used these to specify what project and service a container is part of, a whole load of stuff becomes a lot simpler. We don't have to do gross things like
project, service, n = container_name.split("_", 3)
.Questions:
docker exec project_web_1
) and we want something useful to show up indocker ps
The text was updated successfully, but these errors were encountered: