{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/22268","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/22268/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/22268/comments","events_url":"https://api.github.com/repos/docker/docker/issues/22268/events","html_url":"https://github.com/docker/docker/pull/22268","id":150524295,"number":22268,"title":"Support platform semantic file paths through ESCAPE","user":{"login":"jhowardmsft","id":10522484,"avatar_url":"https://avatars.githubusercontent.com/u/10522484?v=3","gravatar_id":"","url":"https://api.github.com/users/jhowardmsft","html_url":"https://github.com/jhowardmsft","followers_url":"https://api.github.com/users/jhowardmsft/followers","following_url":"https://api.github.com/users/jhowardmsft/following{/other_user}","gists_url":"https://api.github.com/users/jhowardmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/jhowardmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhowardmsft/subscriptions","organizations_url":"https://api.github.com/users/jhowardmsft/orgs","repos_url":"https://api.github.com/users/jhowardmsft/repos","events_url":"https://api.github.com/users/jhowardmsft/events{/privacy}","received_events_url":"https://api.github.com/users/jhowardmsft/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/group/distribution","name":"group/distribution","color":"F6FBFF"},{"url":"https://api.github.com/repos/docker/docker/labels/group/windows","name":"group/windows","color":"F6FBFF"},{"url":"https://api.github.com/repos/docker/docker/labels/impact/changelog","name":"impact/changelog","color":"bfe5bf"},{"url":"https://api.github.com/repos/docker/docker/labels/impact/dockerfile","name":"impact/dockerfile","color":"bfe5bf"},{"url":"https://api.github.com/repos/docker/docker/labels/status/3-docs-review","name":"status/3-docs-review","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/53","html_url":"https://github.com/docker/docker/milestones/1.12.0","labels_url":"https://api.github.com/repos/docker/docker/milestones/53/labels","id":1657301,"number":53,"title":"1.12.0","description":"","creator":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":78,"state":"open","created_at":"2016-03-21T13:47:53Z","updated_at":"2016-05-20T15:19:44Z","due_on":null,"closed_at":null},"comments":77,"created_at":"2016-04-23T06:46:14Z","updated_at":"2016-05-21T00:47:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/22268","html_url":"https://github.com/docker/docker/pull/22268","diff_url":"https://github.com/docker/docker/pull/22268.diff","patch_url":"https://github.com/docker/docker/pull/22268.patch"},"body":"Signed-off-by: John Howard <jhoward@microsoft.com>\r\n\r\nFixes https://github.com/docker/docker/issues/21697\r\n\r\nAlthough not strictly Windows specific, this PR adds full support for native Windows file paths (when combined with https://github.com/docker/docker/pull/22181) in a Dockerfile, and it's main reason for submission is for Windows. \r\n\r\nThis PR significantly lowers the barrier to entry of Docker on Windows by Windows users from nuances in a Dockerfile, due there being situations where Linux style semantics are required. Note that this PR does not remove the option for Linux-style semantics at all - just provides a more natural alternative. So it is still absolutely possible to create cross-platform capable Dockerfiles for simple scenarios.\r\n\r\nIn this PR, a parser directive `ESCAPE` has been added (it is -not- a builder step creating a layer). This parser directive changes how subsequent lines of a Dockerfile are parsed. It allows the user to define the character which is the `escape` character. Before this PR, the only (hard-coded) escape character supported by the docker daemon was `\\`. This was somewhat unfortunate as (see the docs bit of the PR for more info) `\\` is also the file path separator on Windows. Hence statements such as `ADD foo.txt \\` or `COPY foo.txt c:\\` or `RUN cmd /s /c dir c:\\myfolder\\` do not work as expected on the Windows platform without this PR. Further, it is sometimes necessary to do unusual things such as expressing a full filepath by using double-backslash such as `c:\\\\path\\\\to\\\\file.txt`\r\n\r\nThe only two characters possible are backtick and backslash. It was a very deliberate choice to not allow any arbitrary character. At this time, there is little justification for that level of customisation. The backtick was specifically chosen as that is consistent with PowerShell. See https://technet.microsoft.com/en-us/library/hh847755.aspx for more information. \r\n\r\nMore information on usage and examples are in builder.md, updated in this PR.\r\n\r\nThis is something we would like added before TP5 when we expect many new users to be looking at Docker on Windows for the first time, and a good time to move existing users across to something far more natural.\r\n\r\n@friism @StefanScherer @icecrime @tiborvass"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/220748707","html_url":"https://github.com/docker/docker/pull/22268#issuecomment-220748707","issue_url":"https://api.github.com/repos/docker/docker/issues/22268","id":220748707,"user":{"login":"crosbymichael","id":749551,"avatar_url":"https://avatars.githubusercontent.com/u/749551?v=3","gravatar_id":"","url":"https://api.github.com/users/crosbymichael","html_url":"https://github.com/crosbymichael","followers_url":"https://api.github.com/users/crosbymichael/followers","following_url":"https://api.github.com/users/crosbymichael/following{/other_user}","gists_url":"https://api.github.com/users/crosbymichael/gists{/gist_id}","starred_url":"https://api.github.com/users/crosbymichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crosbymichael/subscriptions","organizations_url":"https://api.github.com/users/crosbymichael/orgs","repos_url":"https://api.github.com/users/crosbymichael/repos","events_url":"https://api.github.com/users/crosbymichael/events{/privacy}","received_events_url":"https://api.github.com/users/crosbymichael/received_events","type":"User","site_admin":false},"created_at":"2016-05-21T00:47:28Z","updated_at":"2016-05-21T00:47:28Z","body":"`# escape=\\`\r\n\r\n#### Parser directive must be on the first line ( we can modify this to support multiple lines later but they are always the first lines of the dockerfile ).\r\n\r\nGood:\r\n```\r\n# escape=\\\r\n\r\nFROM alpine\r\n```\r\n\r\nBad:\r\n```\r\n# my file\r\n# escape=\\\r\n\r\nFROM alpine\r\n```\r\n\r\nThis should not throw an error, but it should not work in changing the parsing logic.\r\n\r\n#### Documentation should promote best practices.  Lower case and promote having an empty line between the build directive and rest of the file.\r\n\r\nGood:\r\n```\r\n# escape=`\r\n\r\n# Redis Image\r\n# version something\r\n\r\nFROM ubuntu\r\nRUN apt-get install -y redis\r\n```\r\n\r\nBad:\r\n```\r\n# escape=`\r\n# Redis Image\r\n# version something\r\n\r\nFROM ubuntu\r\nRUN apt-get install -y redis\r\n```\r\n\r\n#### Parser directives must be stopped after the first failed line.  \r\n\r\npsudocode:\r\n\r\n```go\r\n// parse directives from beginning of file\r\ndirectives := []string{}\r\nfor _, line := range dockerfile {\r\n    if !isParserDirective(line) {\r\n        // no more directives\r\n        break\r\n    }\r\n    // then add the directive\r\n    directives = append(directives, line)\r\n}\r\n```\r\n\r\nThese bad examples should not generate hard errors for many reasons of backwards compat but the requirements are simple and straight forward.  Parser directives are the first lines in the file, anything other than that, invalid or an empty line, stops the parsing of directives and then things go on as normal.  \r\n\r\nLets get this feature done with the above requirements or close the PR.  @jhowardmsft if you don't have time or want to make these changes let me know and I'll do it.  I've read all the comments and I believe this is what is best and we just need to have a decision and stick with it. "}}
{"actor":{"display_login":"crosbymichael"}}