{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/14634","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/14634/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/14634/comments","events_url":"https://api.github.com/repos/docker/docker/issues/14634/events","html_url":"https://github.com/docker/docker/issues/14634","id":95053949,"number":14634,"title":"Builder - Build-time argument passing (e.g., HTTP_PROXY)","user":{"login":"icecrime","id":1564054,"avatar_url":"https://avatars.githubusercontent.com/u/1564054?v=3","gravatar_id":"","url":"https://api.github.com/users/icecrime","html_url":"https://github.com/icecrime","followers_url":"https://api.github.com/users/icecrime/followers","following_url":"https://api.github.com/users/icecrime/following{/other_user}","gists_url":"https://api.github.com/users/icecrime/gists{/gist_id}","starred_url":"https://api.github.com/users/icecrime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icecrime/subscriptions","organizations_url":"https://api.github.com/users/icecrime/orgs","repos_url":"https://api.github.com/users/icecrime/repos","events_url":"https://api.github.com/users/icecrime/events{/privacy}","received_events_url":"https://api.github.com/users/icecrime/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/41","html_url":"https://github.com/docker/docker/milestones/1.9.0","labels_url":"https://api.github.com/repos/docker/docker/milestones/41/labels","id":1211905,"number":41,"title":"1.9.0","description":"","creator":{"login":"dmp42","id":332946,"avatar_url":"https://avatars.githubusercontent.com/u/332946?v=3","gravatar_id":"","url":"https://api.github.com/users/dmp42","html_url":"https://github.com/dmp42","followers_url":"https://api.github.com/users/dmp42/followers","following_url":"https://api.github.com/users/dmp42/following{/other_user}","gists_url":"https://api.github.com/users/dmp42/gists{/gist_id}","starred_url":"https://api.github.com/users/dmp42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmp42/subscriptions","organizations_url":"https://api.github.com/users/dmp42/orgs","repos_url":"https://api.github.com/users/dmp42/repos","events_url":"https://api.github.com/users/dmp42/events{/privacy}","received_events_url":"https://api.github.com/users/dmp42/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":237,"state":"closed","created_at":"2015-07-16T20:50:09Z","updated_at":"2016-02-11T11:45:49Z","due_on":"2015-11-03T05:00:00Z","closed_at":"2015-11-03T20:09:05Z"},"comments":47,"created_at":"2015-07-14T22:10:33Z","updated_at":"2016-03-20T13:04:03Z","closed_at":"2015-09-17T16:11:09Z","body":"# Description\r\n\r\nIn the past, we refused pull requests which were basically allowing to inject environment variables or such through the command line as it makes it too easy to write a Dockerfile which would only build assuming you know what it expects. We believe this would hinder repeatability of builds.\r\n\r\nNevertheless, there is a real need for build-time argument passing, one example which we often get being `HTTP_PROXY`. We believe Docker should have a predefined set of general purpose build-time variables it allows to override like this one, as well as a Dockerfile instruction allowing to define image-specific ones.\r\n\r\n# How to\r\n\r\nThe best description of the solution is described here https://github.com/docker/docker/pull/9176#issuecomment-115879217. However, we would still like to prioritize client-side build (#14298) before moving on to this feature.\r\n\r\nTo give a few more details:\r\n- Introduce a new `ARG` Dockerfile instruction that defines a build-time argument. The instruction take the name of the argument, a default value (which can be empty), and an optional description.\r\n- Introduce an internal list of builtin, Engine-provided, build arguments. In a first version, the set of predefined arguments will be `HTTP_PROXY`, `HTTPS_PROXY`, `FTP_PROXY`, and `NO_PROXY`.\r\n- Introduce a new `--build-arg` command-line flag to `docker build` that will receive argument values (e.g., `docker build --build-arg HTTP_PROXY=http://...`) in a similar way that `docker run -e` works today.\r\n- Build-time arguments will not be persisted into the resulting image.\r\n- Build-time arguments are injected in the environment of commands being `RUN`'ed as part of the build.\r\n- Build-time arguments are available as substitution throughout the Dockerfile (for example, they can be used as part of an `ENV` instruction).\r\n\r\n# What's next\r\n\r\nPing @duglin for review.\r\nPing @mapuri: we'd really appreciate if you could close your original PR and submit a rebased version of it that implements the spec described here. Thanks again for your patience :+1:\r\n\r\nTentatively adding this to the 1.9.0 milestone."},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/198927089","html_url":"https://github.com/docker/docker/issues/14634#issuecomment-198927089","issue_url":"https://api.github.com/repos/docker/docker/issues/14634","id":198927089,"user":{"login":"alvinchevolleaux","id":3525721,"avatar_url":"https://avatars.githubusercontent.com/u/3525721?v=3","gravatar_id":"","url":"https://api.github.com/users/alvinchevolleaux","html_url":"https://github.com/alvinchevolleaux","followers_url":"https://api.github.com/users/alvinchevolleaux/followers","following_url":"https://api.github.com/users/alvinchevolleaux/following{/other_user}","gists_url":"https://api.github.com/users/alvinchevolleaux/gists{/gist_id}","starred_url":"https://api.github.com/users/alvinchevolleaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvinchevolleaux/subscriptions","organizations_url":"https://api.github.com/users/alvinchevolleaux/orgs","repos_url":"https://api.github.com/users/alvinchevolleaux/repos","events_url":"https://api.github.com/users/alvinchevolleaux/events{/privacy}","received_events_url":"https://api.github.com/users/alvinchevolleaux/received_events","type":"User","site_admin":false},"created_at":"2016-03-20T13:04:03Z","updated_at":"2016-03-20T13:04:03Z","body":"Is there some sort of prompt option when building a Docker image? I don't really like passing passwords in cleartext via command line. An prompt option in the build process would also make building more interactive and self explanatory without the user needing to be aware of many command line arguments before building. Of course for automated builds you could just pass some no prompt flag."}}