{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/16302","labels_url":"https://api.github.com/repos/docker/docker/issues/16302/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/16302/comments","events_url":"https://api.github.com/repos/docker/docker/issues/16302/events","html_url":"https://github.com/docker/docker/issues/16302","id":106550009,"number":16302,"title":"enhancement: ability to specify file v folder mount","user":{"login":"tony-kerz","id":1223231,"avatar_url":"https://avatars.githubusercontent.com/u/1223231?v=3","gravatar_id":"","url":"https://api.github.com/users/tony-kerz","html_url":"https://github.com/tony-kerz","followers_url":"https://api.github.com/users/tony-kerz/followers","following_url":"https://api.github.com/users/tony-kerz/following{/other_user}","gists_url":"https://api.github.com/users/tony-kerz/gists{/gist_id}","starred_url":"https://api.github.com/users/tony-kerz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tony-kerz/subscriptions","organizations_url":"https://api.github.com/users/tony-kerz/orgs","repos_url":"https://api.github.com/users/tony-kerz/repos","events_url":"https://api.github.com/users/tony-kerz/events{/privacy}","received_events_url":"https://api.github.com/users/tony-kerz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/exp/intermediate","name":"exp/intermediate","color":"79BD9A"},{"url":"https://api.github.com/repos/docker/docker/labels/kind/feature","name":"kind/feature","color":"AAB3AB"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-15T12:59:01Z","updated_at":"2015-09-16T03:17:19Z","closed_at":null,"body":"i have ran into problems in the past attempting to mount a file that is accidentally not present.\r\n\r\ndocker will assume that i want to mount a folder and it will create a folder (named after the missing file) creating confusion.\r\n\r\nfor example:\r\n\r\n```\r\ndocker run -v /path/to/file.txt:/file.txt me/my-image\r\n```\r\n\r\nwill create a folder named `file.txt` at `/path/to` if `/path/to/file.txt` doesn't exist.\r\n\r\ni burned a few hours on this once with a docker-ized node app that was complaining that i was trying to open a folder as a file.\r\n\r\ni thought it might be smoother if i could signal to docker that i am going after a file v a folder, and then if i specify `:ro` have it throw an error if it doesn't exist, or if it is `:rw` (default) have it just create the file.\r\n\r\n\r\n\r\nso something like a `-f` option to indicate mounting a file, like so:\r\n\r\n```\r\ndocker run -f /path/to/file.txt:/file.txt me/my-image\r\n```"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/140613865","html_url":"https://github.com/docker/docker/issues/16302#issuecomment-140613865","issue_url":"https://api.github.com/repos/docker/docker/issues/16302","id":140613865,"user":{"login":"tony-kerz","id":1223231,"avatar_url":"https://avatars.githubusercontent.com/u/1223231?v=3","gravatar_id":"","url":"https://api.github.com/users/tony-kerz","html_url":"https://github.com/tony-kerz","followers_url":"https://api.github.com/users/tony-kerz/followers","following_url":"https://api.github.com/users/tony-kerz/following{/other_user}","gists_url":"https://api.github.com/users/tony-kerz/gists{/gist_id}","starred_url":"https://api.github.com/users/tony-kerz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tony-kerz/subscriptions","organizations_url":"https://api.github.com/users/tony-kerz/orgs","repos_url":"https://api.github.com/users/tony-kerz/repos","events_url":"https://api.github.com/users/tony-kerz/events{/privacy}","received_events_url":"https://api.github.com/users/tony-kerz/received_events","type":"User","site_admin":false},"created_at":"2015-09-16T03:17:19Z","updated_at":"2015-09-16T03:17:19Z","body":"@mikebrow good points.\r\n\r\ni would think being able to force a fail v output would be more fool-proof, but what ever the command-line ux pros agree is good practice is fine with me as long there is a way to indicate that you intend to mount a file."}}