-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Docker --name option #387
Comments
@LordFPL Container names have to be unique across the cluster (we might start more than one container from the same job on a single host), and as such they have some randomly-generated string in the name no matter what. It seems like labels are a better fit for cross-referencing. For instance, we could attach a label to the container that indicates the name of the job that started it, and potentially other metadata Nomad has available. I think this might satisfy your use-case better. Any thoughts about this? |
Thx for your answer :) I have to test if label can be a solution... but i always found name in "docker ps" more understandable than label. Imho label are more for informations about an app (dev/prod, locality, project, team, etc...) I understand the problem of unicity accross the cluster, but with PR #321 maybe an implicit constraint can be added ? (If option contain --name then constraint = distinctHost... or something like that...) |
The naming issue should not be conflated with a scheduling restriction. If it's your intent to never colocate two instances of a job on the same machine, that should be explicit. I think it would be surprising to most people that giving their container a name prevented it from being scheduled. The proposed change in #389 works around the naming uniqueness issue by essentially randomizing it, so I'm curious whether the proposed solution would actually work for your intended use case. From some brief digging I did, cAdvisor, telegraf, and Prometheus all support labels now. I think labels are probably the best solution either way, since they to not carry additional implications for the docker runtime. |
AFAIK logspout (https://github.com/gliderlabs/logspout/) does not look at docker container labels, and logstash filters on the receiving end could easily filter out the allocation ID (or whatever gets appended) from the name. On the other hand, logspout does send the docker image name along with the log data, so that may also be sufficient for most people's needs. |
+1 |
Sorry for late answer, the #389 change is a good solution imho... and will be much better than random docker names. |
Closing this as #389 addresses it. For background we append the alloc id to ensure that the name is unique. Otherwise docker name adds the potential for conflicts. |
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
Hello,
Following a conversation on the newsgroup (https://groups.google.com/forum/#!topic/nomad-tool/WrTGqvjW6xo) I will wish be able to set in a Nomad job the name of a container (--name option in docker).
The reason is a easier viewing on the host machine, but also for monitoring tools that use this value.
Thanks in advance :)
The text was updated successfully, but these errors were encountered: