{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/13178","labels_url":"https://api.github.com/repos/docker/docker/issues/13178/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/13178/comments","events_url":"https://api.github.com/repos/docker/docker/issues/13178/events","html_url":"https://github.com/docker/docker/issues/13178","id":75914808,"number":13178,"title":"Proposal: Add \"runtime\" labels support when building","user":{"login":"vdemeester","id":6508,"avatar_url":"https://avatars.githubusercontent.com/u/6508?v=3","gravatar_id":"","url":"https://api.github.com/users/vdemeester","html_url":"https://github.com/vdemeester","followers_url":"https://api.github.com/users/vdemeester/followers","following_url":"https://api.github.com/users/vdemeester/following{/other_user}","gists_url":"https://api.github.com/users/vdemeester/gists{/gist_id}","starred_url":"https://api.github.com/users/vdemeester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdemeester/subscriptions","organizations_url":"https://api.github.com/users/vdemeester/orgs","repos_url":"https://api.github.com/users/vdemeester/repos","events_url":"https://api.github.com/users/vdemeester/events{/privacy}","received_events_url":"https://api.github.com/users/vdemeester/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/kind/feature","name":"kind/feature","color":"AAB3AB"},{"url":"https://api.github.com/repos/docker/docker/labels/kind/proposal","name":"kind/proposal","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-13T09:24:41Z","updated_at":"2015-05-15T09:12:42Z","closed_at":null,"body":"## Background\r\n\r\nExternal tools, like [docker/compose](https://github.com/docker/compose) are currently using name convention to identify image they build as part as their workflow, in order to find them back and manage them. As proposed in this [issue #1403](https://github.com/docker/compose/issues/1403), it would be easier and more flexible to use *labels* for this use cases.\r\n\r\nThe current way to add labels to images are to add ``LABEL`` lines in ``Dockerfile``. This proposal aims to add a flag(s) to the ``build`` command to allow settings labels to images when building them **and** support this in the API as well (so external tools can work with it).\r\n\r\nAlthough the main use case that comes in mind for me is the use in external tools like compose, I think it's good to be abel to add image label as part of the building, that weren't defined in the ``Dockerfile``.\r\n\r\n## Syntax\r\n\r\nTo be coherent, the syntax should act the same as when using the ``run`` command (``--label`` and ``--label-files``).\r\n\r\n```bash\r\n$ docker build --label key=value -t myimage .\r\n$ docker build --label key1=value1 --label key2=value2 -t myimage .\r\n$ docker build --label-file=mybuildinglabels -t myimage .\r\n```\r\n\r\nLet me now how you feel about that. I can work on it if this is something the community finds it useful."},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/102333174","html_url":"https://github.com/docker/docker/issues/13178#issuecomment-102333174","issue_url":"https://api.github.com/repos/docker/docker/issues/13178","id":102333174,"user":{"login":"derfred","id":24133,"avatar_url":"https://avatars.githubusercontent.com/u/24133?v=3","gravatar_id":"","url":"https://api.github.com/users/derfred","html_url":"https://github.com/derfred","followers_url":"https://api.github.com/users/derfred/followers","following_url":"https://api.github.com/users/derfred/following{/other_user}","gists_url":"https://api.github.com/users/derfred/gists{/gist_id}","starred_url":"https://api.github.com/users/derfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derfred/subscriptions","organizations_url":"https://api.github.com/users/derfred/orgs","repos_url":"https://api.github.com/users/derfred/repos","events_url":"https://api.github.com/users/derfred/events{/privacy}","received_events_url":"https://api.github.com/users/derfred/received_events","type":"User","site_admin":false},"created_at":"2015-05-15T09:12:42Z","updated_at":"2015-05-15T09:12:42Z","body":"+1, I have a couple of internal images that combine to repositories. One contains the application code, the other the infrastructure code. I would like to embed the git sha1's as labels in the resulting images"}}