{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/40299380","id":40299380,"diff_hunk":"@@ -17,6 +17,7 @@ import (\n func (cli *DockerCli) CmdPull(args ...string) error {\n \tcmd := Cli.Subcmd(\"pull\", []string{\"NAME[:TAG|@DIGEST]\"}, \"Pull an image or a repository from a registry\", true)\n \tallTags := cmd.Bool([]string{\"a\", \"-all-tags\"}, false, \"Download all tagged images in the repository\")\n+\tdryRun := cmd.Bool([]string{\"d\", \"-dry-run\"}, false, \"Dry run mode - only displays the download size\")","path":"api/client/pull.go","position":4,"original_position":4,"commit_id":"0c62d94de8946900587e68586f73bf31d906b273","original_commit_id":"0c62d94de8946900587e68586f73bf31d906b273","user":{"login":"ygravrand","id":3704957,"avatar_url":"https://avatars.githubusercontent.com/u/3704957?v=3","gravatar_id":"","url":"https://api.github.com/users/ygravrand","html_url":"https://github.com/ygravrand","followers_url":"https://api.github.com/users/ygravrand/followers","following_url":"https://api.github.com/users/ygravrand/following{/other_user}","gists_url":"https://api.github.com/users/ygravrand/gists{/gist_id}","starred_url":"https://api.github.com/users/ygravrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ygravrand/subscriptions","organizations_url":"https://api.github.com/users/ygravrand/orgs","repos_url":"https://api.github.com/users/ygravrand/repos","events_url":"https://api.github.com/users/ygravrand/events{/privacy}","received_events_url":"https://api.github.com/users/ygravrand/received_events","type":"User","site_admin":false},"body":"@cpuguy83 What do you suggest? ``-n`` as in #1512 ?","created_at":"2015-09-24T09:17:49Z","updated_at":"2015-09-24T09:17:49Z","html_url":"https://github.com/docker/docker/pull/16450#discussion_r40299380","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/16450","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/40299380"},"html":{"href":"https://github.com/docker/docker/pull/16450#discussion_r40299380"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/16450"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/16450","id":45544448,"html_url":"https://github.com/docker/docker/pull/16450","diff_url":"https://github.com/docker/docker/pull/16450.diff","patch_url":"https://github.com/docker/docker/pull/16450.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/16450","number":16450,"state":"open","locked":false,"title":"Docker pull \"dry run\" mode","user":{"login":"ygravrand","id":3704957,"avatar_url":"https://avatars.githubusercontent.com/u/3704957?v=3","gravatar_id":"","url":"https://api.github.com/users/ygravrand","html_url":"https://github.com/ygravrand","followers_url":"https://api.github.com/users/ygravrand/followers","following_url":"https://api.github.com/users/ygravrand/following{/other_user}","gists_url":"https://api.github.com/users/ygravrand/gists{/gist_id}","starred_url":"https://api.github.com/users/ygravrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ygravrand/subscriptions","organizations_url":"https://api.github.com/users/ygravrand/orgs","repos_url":"https://api.github.com/users/ygravrand/repos","events_url":"https://api.github.com/users/ygravrand/events{/privacy}","received_events_url":"https://api.github.com/users/ygravrand/received_events","type":"User","site_admin":false},"body":"This is our contribution to Docker Global Hack Day 3.\r\nIt adds the ability to \"dry run\" a \"docker pull\" command, obtaining only the total size of image layers that have to be downloaded.\r\nA new ``-d`` flag activates this mode:\r\n```\r\ndocker pull -d jenkins\r\nUsing default tag: latest\r\nINFO[0005] POST /v1.21/images/create?dryRun=true&fromImage=jenkins%3Alatest \r\nINFO[0008] Image manifest for jenkins:latest has been verified \r\n**** Dry Run - nothing will be downloaded ****\r\nlatest: Pulling from library/jenkins\r\nlatest: Dry Run: 376344319 bytes to be downloaded, in 33 layers\r\nStatus: Dry Run completed for jenkins:latest\r\n```\r\n\r\nAt the end of the Hackaton, we found this related Feature request: https://github.com/docker/docker/issues/1512. Although it's labelled \"docker pull info\", a comment by @unclejack states that a flag approach would be preferred.\r\nSo it seems we're in the right direction with this.\r\n\r\n--\r\nSome limitations:\r\n- Currently only works with v2 registry. \r\n- Does not work if a background pull is already running on the same image (but displays a nice warning ;-) )\r\n- Please review the REST API and CLI parts to be sure we did not break anything.\r\n","created_at":"2015-09-21T12:50:48Z","updated_at":"2015-09-24T09:17:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31c22d9f4e1af0ca1150b7d7c1f0fb136c7a0e93","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/16450/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/16450/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/16450/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/0c62d94de8946900587e68586f73bf31d906b273","head":{"label":"srevereault:pull-dry-run","ref":"pull-dry-run","sha":"0c62d94de8946900587e68586f73bf31d906b273","user":{"login":"srevereault","id":1890300,"avatar_url":"https://avatars.githubusercontent.com/u/1890300?v=3","gravatar_id":"","url":"https://api.github.com/users/srevereault","html_url":"https://github.com/srevereault","followers_url":"https://api.github.com/users/srevereault/followers","following_url":"https://api.github.com/users/srevereault/following{/other_user}","gists_url":"https://api.github.com/users/srevereault/gists{/gist_id}","starred_url":"https://api.github.com/users/srevereault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srevereault/subscriptions","organizations_url":"https://api.github.com/users/srevereault/orgs","repos_url":"https://api.github.com/users/srevereault/repos","events_url":"https://api.github.com/users/srevereault/events{/privacy}","received_events_url":"https://api.github.com/users/srevereault/received_events","type":"User","site_admin":false},"repo":{"id":42859728,"name":"docker","full_name":"srevereault/docker","owner":{"login":"srevereault","id":1890300,"avatar_url":"https://avatars.githubusercontent.com/u/1890300?v=3","gravatar_id":"","url":"https://api.github.com/users/srevereault","html_url":"https://github.com/srevereault","followers_url":"https://api.github.com/users/srevereault/followers","following_url":"https://api.github.com/users/srevereault/following{/other_user}","gists_url":"https://api.github.com/users/srevereault/gists{/gist_id}","starred_url":"https://api.github.com/users/srevereault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srevereault/subscriptions","organizations_url":"https://api.github.com/users/srevereault/orgs","repos_url":"https://api.github.com/users/srevereault/repos","events_url":"https://api.github.com/users/srevereault/events{/privacy}","received_events_url":"https://api.github.com/users/srevereault/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/srevereault/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/srevereault/docker","forks_url":"https://api.github.com/repos/srevereault/docker/forks","keys_url":"https://api.github.com/repos/srevereault/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/srevereault/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/srevereault/docker/teams","hooks_url":"https://api.github.com/repos/srevereault/docker/hooks","issue_events_url":"https://api.github.com/repos/srevereault/docker/issues/events{/number}","events_url":"https://api.github.com/repos/srevereault/docker/events","assignees_url":"https://api.github.com/repos/srevereault/docker/assignees{/user}","branches_url":"https://api.github.com/repos/srevereault/docker/branches{/branch}","tags_url":"https://api.github.com/repos/srevereault/docker/tags","blobs_url":"https://api.github.com/repos/srevereault/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/srevereault/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/srevereault/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/srevereault/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/srevereault/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/srevereault/docker/languages","stargazers_url":"https://api.github.com/repos/srevereault/docker/stargazers","contributors_url":"https://api.github.com/repos/srevereault/docker/contributors","subscribers_url":"https://api.github.com/repos/srevereault/docker/subscribers","subscription_url":"https://api.github.com/repos/srevereault/docker/subscription","commits_url":"https://api.github.com/repos/srevereault/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/srevereault/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/srevereault/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/srevereault/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/srevereault/docker/contents/{+path}","compare_url":"https://api.github.com/repos/srevereault/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/srevereault/docker/merges","archive_url":"https://api.github.com/repos/srevereault/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/srevereault/docker/downloads","issues_url":"https://api.github.com/repos/srevereault/docker/issues{/number}","pulls_url":"https://api.github.com/repos/srevereault/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/srevereault/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/srevereault/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/srevereault/docker/labels{/name}","releases_url":"https://api.github.com/repos/srevereault/docker/releases{/id}","created_at":"2015-09-21T10:30:16Z","updated_at":"2015-09-23T12:20:49Z","pushed_at":"2015-09-21T20:12:38Z","git_url":"git://github.com/srevereault/docker.git","ssh_url":"git@github.com:srevereault/docker.git","clone_url":"https://github.com/srevereault/docker.git","svn_url":"https://github.com/srevereault/docker","homepage":"http://www.docker.com","size":68395,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"4a6e8c8f3c8d129bb06922a0d8e1e1276c254f66","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-09-24T07:51:07Z","pushed_at":"2015-09-24T08:54:40Z","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":256824,"stargazers_count":25003,"watchers_count":25003,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6506,"mirror_url":null,"open_issues_count":1076,"forks":6506,"open_issues":1076,"watchers":25003,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/16450"},"html":{"href":"https://github.com/docker/docker/pull/16450"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/16450"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/16450/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/16450/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/16450/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/0c62d94de8946900587e68586f73bf31d906b273"}}}}