{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/5369","labels_url":"https://api.github.com/repos/docker/docker/issues/5369/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/5369/comments","events_url":"https://api.github.com/repos/docker/docker/issues/5369/events","html_url":"https://github.com/docker/docker/pull/5369","id":32104517,"number":5369,"title":"Added the BINDCONTEXT dockerfile instruction","user":{"login":"a-ba","id":6051986,"avatar_url":"https://avatars.githubusercontent.com/u/6051986?v=3","gravatar_id":"","url":"https://api.github.com/users/a-ba","html_url":"https://github.com/a-ba","followers_url":"https://api.github.com/users/a-ba/followers","following_url":"https://api.github.com/users/a-ba/following{/other_user}","gists_url":"https://api.github.com/users/a-ba/gists{/gist_id}","starred_url":"https://api.github.com/users/a-ba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-ba/subscriptions","organizations_url":"https://api.github.com/users/a-ba/orgs","repos_url":"https://api.github.com/users/a-ba/repos","events_url":"https://api.github.com/users/a-ba/events{/privacy}","received_events_url":"https://api.github.com/users/a-ba/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":42,"created_at":"2014-04-23T22:13:25Z","updated_at":"2015-10-09T13:58:30Z","closed_at":"2015-01-06T18:05:48Z","pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/5369","html_url":"https://github.com/docker/docker/pull/5369","diff_url":"https://github.com/docker/docker/pull/5369.diff","patch_url":"https://github.com/docker/docker/pull/5369.patch"},"body":"closes #3056\r\n\r\nThe `BINDCONTEXT <mountpoint>` instruction arranges for the context to be mounted at the location `<mountpoint>` inside the container during the subsequent `RUN` commands.\r\n\r\nThe context is mounted in read-write mode. This is convenient when building something from sources located in the context since only files that are explicitly installed will persist in the image. Everything else (sources, intermediate files,...) is wiped out when the build is over.\r\n\r\nThe command is also useful when dealing with a voluminous files. Using BINDCONTEXT instead of ADD avoid making extra copies of temporary files and avoids keeping them in the final image. Depending on the case, this can mitigate #2224 and #332.\r\n\r\nThere are two outstanding questions:\r\n 1. the command mounts *directly* the context directory and let the user modify it (and possibly mess up with next dockerfile commands). An alternatives would be to write changes in an aufs layer to leave the server context intact, but this adds a dependency on aufs (and I wondef if this is really necessary).\r\n\r\n 2. the <mountpoint> stays in the image after the build and is listed in the 'Volumes' section of the image config. Ideally I would prefer removing it from the config and from the filesystem (if it did not exist prior to the mount). I am not very familiay with the runtime API, is there a way to do that cleanly before the commit ?\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/146879038","html_url":"https://github.com/docker/docker/pull/5369#issuecomment-146879038","issue_url":"https://api.github.com/repos/docker/docker/issues/5369","id":146879038,"user":{"login":"dagelf","id":802628,"avatar_url":"https://avatars.githubusercontent.com/u/802628?v=3","gravatar_id":"","url":"https://api.github.com/users/dagelf","html_url":"https://github.com/dagelf","followers_url":"https://api.github.com/users/dagelf/followers","following_url":"https://api.github.com/users/dagelf/following{/other_user}","gists_url":"https://api.github.com/users/dagelf/gists{/gist_id}","starred_url":"https://api.github.com/users/dagelf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagelf/subscriptions","organizations_url":"https://api.github.com/users/dagelf/orgs","repos_url":"https://api.github.com/users/dagelf/repos","events_url":"https://api.github.com/users/dagelf/events{/privacy}","received_events_url":"https://api.github.com/users/dagelf/received_events","type":"User","site_admin":false},"created_at":"2015-10-09T13:58:30Z","updated_at":"2015-10-09T13:58:30Z","body":"The /tmp use case would be useless if you're wanting to have a local apt or portage repository available (which you don't want in the image.) In the case of the apt respository - Ubuntu knows to fetch it from a certain path, or from the internet if that path is not available. "}}