{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/46352045","id":46352045,"diff_hunk":"@@ -0,0 +1,57 @@\n+# This file describes the standard way to build Docker, using docker on TP4\n+#\n+# Usage:\n+#\n+# # Assemble the full dev environment. This is slow the first time.\n+# docker build -t docker -f Dockerfile.windows .\n+#\n+# # Mount your source in an interactive container for quick testing:\n+# docker run -it -v ${pwd}\\bundles:c:/go/src/github.com/docker/docker/bundles docker cmd\n+#\n+# # Build the docker binary in bundles\\docker.exe\n+# docker run -it -v ${pwd}\\bundles:c:/go/src/github.com/docker/docker/bundles docker \"powershell -file hack\\make.ps1\"\n+#\n+\n+FROM windowsservercore\n+\n+ENV GOLANG_VERSION 1.5.1\n+\n+RUN mkdir \\go\\bin \\go\\src\n+WORKDIR /go\n+ENV GOPATH C:/go;C:/go/src/github.com/docker/docker/vendor\n+RUN setx PATH %PATH%;C:\\PortableGit\\bin;C:\\PortableGit\\usr\\bin;C:\\tools\\go\\bin;C:\\go\\bin\n+\n+RUN powershell -Command \\\n+    Sleep 2 ; \\\n+    iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) ; \\\n+    choco install -y golang -version %GOLANG_VERSION% ; \\\n+    wget https://github.com/git-for-windows/git/releases/download/v2.6.3.windows.1/PortableGit-2.6.3-64-bit.7z.exe -OutFile \\gitinstaller.exe ; \\","path":"Dockerfile.windows","position":28,"original_position":28,"commit_id":"b4b7deaf38a876c0c6ee6dceeb97e88f42bd2a1b","original_commit_id":"b4b7deaf38a876c0c6ee6dceeb97e88f42bd2a1b","user":{"login":"ahmetalpbalkan","id":159209,"avatar_url":"https://avatars.githubusercontent.com/u/159209?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmetalpbalkan","html_url":"https://github.com/ahmetalpbalkan","followers_url":"https://api.github.com/users/ahmetalpbalkan/followers","following_url":"https://api.github.com/users/ahmetalpbalkan/following{/other_user}","gists_url":"https://api.github.com/users/ahmetalpbalkan/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmetalpbalkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmetalpbalkan/subscriptions","organizations_url":"https://api.github.com/users/ahmetalpbalkan/orgs","repos_url":"https://api.github.com/users/ahmetalpbalkan/repos","events_url":"https://api.github.com/users/ahmetalpbalkan/events{/privacy}","received_events_url":"https://api.github.com/users/ahmetalpbalkan/received_events","type":"User","site_admin":false},"body":"hmm alright, I don't know much about it, I think it's just an alias. If it's a short alias, then we should probably use the canonical command instead.","created_at":"2015-12-01T22:48:37Z","updated_at":"2015-12-01T22:48:37Z","html_url":"https://github.com/docker/docker/pull/18348#discussion_r46352045","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/18348","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/46352045"},"html":{"href":"https://github.com/docker/docker/pull/18348#discussion_r46352045"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/18348"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/18348","id":52317993,"html_url":"https://github.com/docker/docker/pull/18348","diff_url":"https://github.com/docker/docker/pull/18348.diff","patch_url":"https://github.com/docker/docker/pull/18348.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/18348","number":18348,"state":"open","locked":false,"title":"Add initial support building Windows docker in docker","user":{"login":"StefanScherer","id":207759,"avatar_url":"https://avatars.githubusercontent.com/u/207759?v=3","gravatar_id":"","url":"https://api.github.com/users/StefanScherer","html_url":"https://github.com/StefanScherer","followers_url":"https://api.github.com/users/StefanScherer/followers","following_url":"https://api.github.com/users/StefanScherer/following{/other_user}","gists_url":"https://api.github.com/users/StefanScherer/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanScherer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanScherer/subscriptions","organizations_url":"https://api.github.com/users/StefanScherer/orgs","repos_url":"https://api.github.com/users/StefanScherer/repos","events_url":"https://api.github.com/users/StefanScherer/events{/privacy}","received_events_url":"https://api.github.com/users/StefanScherer/received_events","type":"User","site_admin":false},"body":"This PR is a proof of concept to simplify setting up a Windows build environment to build the Docker Engine for Windows.\r\n\r\nAfter following the discussion in #18206 and reading the documentation http://docs.docker.com/opensource/project/software-req-win/ by @jfrazelle I thought there should be an easier way for anybody in the community who wants to start contributing to the effort to bring docker to the Windows platform.\r\n\r\nAnd after testing Docker on TP4 for a while I was sure the time has come to use Docker for a first real task to solve. So I tried to build docker in docker on Windows to keep the host machine clean.\r\n\r\nI agree with @jhowardmsft to use just native Windows tools and PowerShell to work on a Windows host. So I tried to follow that path, keeping away from MinGW/Cygwin shells and just use the tools given on Windows plus an absolute minimum number external tools.\r\n\r\nTo reproduce the build you need\r\n\r\n1. Windows Server 2016 TP4 with Docker installed\r\n2. Git for Windows to clone the GitHub repo.\r\n3. There is no step three.\r\n\r\nThese are the detailed steps by using Chocolatey to install git and clone the PR branch:\r\n\r\n```powershell\r\niex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))\r\nchoco install -y git -params \"/GitAndUnixToolsOnPath\"\r\ngit clone -b add-dockerfile-for-windows https://github.com/hypriot/docker\r\ncd docker\r\n.\\hack\\make.ps1\r\n```\r\n\r\nThe `hack\\make.ps1` script is used both on the host as well inside the Docker container. \r\n\r\n* First a Docker image is built with the `Dockerfile.windows` file to install the tools needed like Go 1.5.1, rsrc, TDM-GCC and so on.\r\n* Then the script starts a Docker container with a volume mounted to the bundles directory and the final docker binary will be copied to the host into `bundles\\docker.exe`.\r\n* Inside the container I encountered a small bash script `hack\\make\\.go-autogen` which the PowerShell script just converts to PowerShell and runs these steps as well.\r\n\r\nThen as an admin you can replace your Docker Engine with\r\n\r\n```powershell\r\nstop-service docker\r\ncd C:\\Windows\\system32\r\ncopy docker.exe docker-tp4.exe\r\ncopy $env:USERPROFILE\\docker\\bundles\\docker.exe docker.exe\r\nstart-service docker\r\n```\r\n\r\nAfter updating the Docker EngineI had the effect that some Container images get lost and I had to tag the base container images with the latest tag again. But this stills proofs me that Docker on Windows is the right thing to do and to push forward. And it will change the way we develop and work on Windows as we can see it on Linux.\r\nThanks to all the effort of the Microsoft team (@ahmetalpbalkan @darrenstahlmsft @taylorb-microsoft ...) to get to this point!\r\n\r\n<img width=\"936\" alt=\"docker-in-docker-works\" src=\"https://cloud.githubusercontent.com/assets/207759/11514728/4bb65d4c-987a-11e5-8316-23d65844221c.png\">\r\n\r\nPS: Now I can start contributing as well and not just annoy you with GitHub issues ;-)","created_at":"2015-12-01T21:24:45Z","updated_at":"2015-12-01T22:48:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"14e0c0c47444e67c710b3fb8f397a99d5b584a17","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/18348/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/18348/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/18348/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/b4b7deaf38a876c0c6ee6dceeb97e88f42bd2a1b","head":{"label":"hypriot:add-dockerfile-for-windows","ref":"add-dockerfile-for-windows","sha":"b4b7deaf38a876c0c6ee6dceeb97e88f42bd2a1b","user":{"login":"hypriot","id":10440767,"avatar_url":"https://avatars.githubusercontent.com/u/10440767?v=3","gravatar_id":"","url":"https://api.github.com/users/hypriot","html_url":"https://github.com/hypriot","followers_url":"https://api.github.com/users/hypriot/followers","following_url":"https://api.github.com/users/hypriot/following{/other_user}","gists_url":"https://api.github.com/users/hypriot/gists{/gist_id}","starred_url":"https://api.github.com/users/hypriot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypriot/subscriptions","organizations_url":"https://api.github.com/users/hypriot/orgs","repos_url":"https://api.github.com/users/hypriot/repos","events_url":"https://api.github.com/users/hypriot/events{/privacy}","received_events_url":"https://api.github.com/users/hypriot/received_events","type":"User","site_admin":false},"repo":{"id":31864761,"name":"docker","full_name":"hypriot/docker","owner":{"login":"hypriot","id":10440767,"avatar_url":"https://avatars.githubusercontent.com/u/10440767?v=3","gravatar_id":"","url":"https://api.github.com/users/hypriot","html_url":"https://github.com/hypriot","followers_url":"https://api.github.com/users/hypriot/followers","following_url":"https://api.github.com/users/hypriot/following{/other_user}","gists_url":"https://api.github.com/users/hypriot/gists{/gist_id}","starred_url":"https://api.github.com/users/hypriot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypriot/subscriptions","organizations_url":"https://api.github.com/users/hypriot/orgs","repos_url":"https://api.github.com/users/hypriot/repos","events_url":"https://api.github.com/users/hypriot/events{/privacy}","received_events_url":"https://api.github.com/users/hypriot/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hypriot/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/hypriot/docker","forks_url":"https://api.github.com/repos/hypriot/docker/forks","keys_url":"https://api.github.com/repos/hypriot/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hypriot/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hypriot/docker/teams","hooks_url":"https://api.github.com/repos/hypriot/docker/hooks","issue_events_url":"https://api.github.com/repos/hypriot/docker/issues/events{/number}","events_url":"https://api.github.com/repos/hypriot/docker/events","assignees_url":"https://api.github.com/repos/hypriot/docker/assignees{/user}","branches_url":"https://api.github.com/repos/hypriot/docker/branches{/branch}","tags_url":"https://api.github.com/repos/hypriot/docker/tags","blobs_url":"https://api.github.com/repos/hypriot/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hypriot/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hypriot/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/hypriot/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hypriot/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/hypriot/docker/languages","stargazers_url":"https://api.github.com/repos/hypriot/docker/stargazers","contributors_url":"https://api.github.com/repos/hypriot/docker/contributors","subscribers_url":"https://api.github.com/repos/hypriot/docker/subscribers","subscription_url":"https://api.github.com/repos/hypriot/docker/subscription","commits_url":"https://api.github.com/repos/hypriot/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/hypriot/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/hypriot/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/hypriot/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/hypriot/docker/contents/{+path}","compare_url":"https://api.github.com/repos/hypriot/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hypriot/docker/merges","archive_url":"https://api.github.com/repos/hypriot/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hypriot/docker/downloads","issues_url":"https://api.github.com/repos/hypriot/docker/issues{/number}","pulls_url":"https://api.github.com/repos/hypriot/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/hypriot/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/hypriot/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hypriot/docker/labels{/name}","releases_url":"https://api.github.com/repos/hypriot/docker/releases{/id}","created_at":"2015-03-08T20:40:50Z","updated_at":"2015-03-08T20:41:00Z","pushed_at":"2015-12-01T21:02:07Z","git_url":"git://github.com/hypriot/docker.git","ssh_url":"git@github.com:hypriot/docker.git","clone_url":"https://github.com/hypriot/docker.git","svn_url":"https://github.com/hypriot/docker","homepage":"http://www.docker.com","size":75452,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"5efb37616ffd4b848578424ebb7b290af9965eff","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","created_at":"2013-01-18T18:10:57Z","updated_at":"2015-12-01T22:17:52Z","pushed_at":"2015-12-01T22:12:00Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":117554,"stargazers_count":26711,"watchers_count":26711,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7221,"mirror_url":null,"open_issues_count":1207,"forks":7221,"open_issues":1207,"watchers":26711,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/18348"},"html":{"href":"https://github.com/docker/docker/pull/18348"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/18348"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/18348/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/18348/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/18348/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/b4b7deaf38a876c0c6ee6dceeb97e88f42bd2a1b"}}}}