{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/14634","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":"open","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":20,"closed_issues":14,"state":"open","created_at":"2015-07-16T20:50:09Z","updated_at":"2015-09-04T16:47:11Z","due_on":null,"closed_at":null},"comments":16,"created_at":"2015-07-14T22:10:33Z","updated_at":"2015-09-04T16:56:43Z","closed_at":null,"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/137790206","html_url":"https://github.com/docker/docker/issues/14634#issuecomment-137790206","issue_url":"https://api.github.com/repos/docker/docker/issues/14634","id":137790206,"user":{"login":"duglin","id":1944671,"avatar_url":"https://avatars.githubusercontent.com/u/1944671?v=3","gravatar_id":"","url":"https://api.github.com/users/duglin","html_url":"https://github.com/duglin","followers_url":"https://api.github.com/users/duglin/followers","following_url":"https://api.github.com/users/duglin/following{/other_user}","gists_url":"https://api.github.com/users/duglin/gists{/gist_id}","starred_url":"https://api.github.com/users/duglin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duglin/subscriptions","organizations_url":"https://api.github.com/users/duglin/orgs","repos_url":"https://api.github.com/users/duglin/repos","events_url":"https://api.github.com/users/duglin/events{/privacy}","received_events_url":"https://api.github.com/users/duglin/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T16:56:43Z","updated_at":"2015-09-04T16:56:43Z","body":"@xenoterracide I think this is a slightly different issue since you're asking for env var substitution on the `ADD` command, which isn't really related to this `ARG` stuff. I would suggest you open up an issue for it but keep in mind that per https://github.com/docker/docker/blob/master/ROADMAP.md#22-dockerfile-syntax it might be postponed (or rejected for now)."}}