{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/38777151","id":38777151,"diff_hunk":"@@ -679,6 +679,22 @@ func dockerCmdInDirWithTimeout(timeout time.Duration, path string, args ...strin\n \treturn out, status, err\n }\n \n+func findContainerExitCode(c *check.C, name string, vargs ...string) (string, int) {\n+\targs := append(vargs, \"inspect\", \"--format='{{ .State.ExitCode }} {{ .State.Error }}'\", name)\n+\tcmd := exec.Command(dockerBinary, args...)\n+\tout, _, err := runCommandWithOutput(cmd)\n+\tif err != nil {\n+\t\tc.Fatal(err, out)\n+\t}\n+\t// return 127 for Windows build testing","path":"integration-cli/docker_utils.go","position":11,"original_position":11,"commit_id":"e806c7ee77ec1c132e7b69ec3d342caef92cd59a","original_commit_id":"e806c7ee77ec1c132e7b69ec3d342caef92cd59a","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},"body":"No idea.... But FWIW, on master I see that Windows is perhaps already doing what you're wanting. docker run busybox foo, pointing to a Linux box. State.ExitCode=-1 on both platforms. echo %ERRORLEVEL% on Windows gives 127. But yes, echo $? on Linux is 1. \r\n\r\nRepeating same on master but using your /etc example. From a both CLI, State.ExitCode=-1. Linux $?=1, Windows %ERRORLEVEL%=1.","created_at":"2015-09-04T17:53:49Z","updated_at":"2015-09-04T17:53:49Z","html_url":"https://github.com/docker/docker/pull/14012#discussion_r38777151","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/14012","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/38777151"},"html":{"href":"https://github.com/docker/docker/pull/14012#discussion_r38777151"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/14012"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/14012","id":38012980,"html_url":"https://github.com/docker/docker/pull/14012","diff_url":"https://github.com/docker/docker/pull/14012.diff","patch_url":"https://github.com/docker/docker/pull/14012.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/14012","number":14012,"state":"open","locked":false,"title":"Change 'docker run' exit codes to distinguish docker/contained errors","user":{"login":"sallyom","id":11166065,"avatar_url":"https://avatars.githubusercontent.com/u/11166065?v=3","gravatar_id":"","url":"https://api.github.com/users/sallyom","html_url":"https://github.com/sallyom","followers_url":"https://api.github.com/users/sallyom/followers","following_url":"https://api.github.com/users/sallyom/following{/other_user}","gists_url":"https://api.github.com/users/sallyom/gists{/gist_id}","starred_url":"https://api.github.com/users/sallyom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sallyom/subscriptions","organizations_url":"https://api.github.com/users/sallyom/orgs","repos_url":"https://api.github.com/users/sallyom/repos","events_url":"https://api.github.com/users/sallyom/events{/privacy}","received_events_url":"https://api.github.com/users/sallyom/received_events","type":"User","site_admin":false},"body":"The purpose of this PR is for users to distinguish Docker errors from\r\ncontained command errors.\r\nThis PR modifies 'docker run' exit codes to follow the chroot standard\r\nfor exit codes.\r\nExit status:\r\n125 if 'docker run' itself fails\r\n126 if contained command cannot be invoked\r\n127 if contained command cannot be found\r\nthe exit status otherwise\r\n\r\nSigned-off-by: Regan McCooey rmccooey27@aol.com (github:rhatdan)\r\n\r\nSigned-off-by: Sally O'Malley <somalley@redhat.com>","created_at":"2015-06-18T14:33:40Z","updated_at":"2015-09-04T17:53:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0d5fc687b4dd9c7eed473e95cdaa0ca02ade3ab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/14012/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/14012/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/14012/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/e806c7ee77ec1c132e7b69ec3d342caef92cd59a","head":{"label":"sallyom:exitCodes","ref":"exitCodes","sha":"e806c7ee77ec1c132e7b69ec3d342caef92cd59a","user":{"login":"sallyom","id":11166065,"avatar_url":"https://avatars.githubusercontent.com/u/11166065?v=3","gravatar_id":"","url":"https://api.github.com/users/sallyom","html_url":"https://github.com/sallyom","followers_url":"https://api.github.com/users/sallyom/followers","following_url":"https://api.github.com/users/sallyom/following{/other_user}","gists_url":"https://api.github.com/users/sallyom/gists{/gist_id}","starred_url":"https://api.github.com/users/sallyom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sallyom/subscriptions","organizations_url":"https://api.github.com/users/sallyom/orgs","repos_url":"https://api.github.com/users/sallyom/repos","events_url":"https://api.github.com/users/sallyom/events{/privacy}","received_events_url":"https://api.github.com/users/sallyom/received_events","type":"User","site_admin":false},"repo":{"id":36450965,"name":"docker","full_name":"sallyom/docker","owner":{"login":"sallyom","id":11166065,"avatar_url":"https://avatars.githubusercontent.com/u/11166065?v=3","gravatar_id":"","url":"https://api.github.com/users/sallyom","html_url":"https://github.com/sallyom","followers_url":"https://api.github.com/users/sallyom/followers","following_url":"https://api.github.com/users/sallyom/following{/other_user}","gists_url":"https://api.github.com/users/sallyom/gists{/gist_id}","starred_url":"https://api.github.com/users/sallyom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sallyom/subscriptions","organizations_url":"https://api.github.com/users/sallyom/orgs","repos_url":"https://api.github.com/users/sallyom/repos","events_url":"https://api.github.com/users/sallyom/events{/privacy}","received_events_url":"https://api.github.com/users/sallyom/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sallyom/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/sallyom/docker","forks_url":"https://api.github.com/repos/sallyom/docker/forks","keys_url":"https://api.github.com/repos/sallyom/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sallyom/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sallyom/docker/teams","hooks_url":"https://api.github.com/repos/sallyom/docker/hooks","issue_events_url":"https://api.github.com/repos/sallyom/docker/issues/events{/number}","events_url":"https://api.github.com/repos/sallyom/docker/events","assignees_url":"https://api.github.com/repos/sallyom/docker/assignees{/user}","branches_url":"https://api.github.com/repos/sallyom/docker/branches{/branch}","tags_url":"https://api.github.com/repos/sallyom/docker/tags","blobs_url":"https://api.github.com/repos/sallyom/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sallyom/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sallyom/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/sallyom/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sallyom/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/sallyom/docker/languages","stargazers_url":"https://api.github.com/repos/sallyom/docker/stargazers","contributors_url":"https://api.github.com/repos/sallyom/docker/contributors","subscribers_url":"https://api.github.com/repos/sallyom/docker/subscribers","subscription_url":"https://api.github.com/repos/sallyom/docker/subscription","commits_url":"https://api.github.com/repos/sallyom/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/sallyom/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/sallyom/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/sallyom/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/sallyom/docker/contents/{+path}","compare_url":"https://api.github.com/repos/sallyom/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sallyom/docker/merges","archive_url":"https://api.github.com/repos/sallyom/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sallyom/docker/downloads","issues_url":"https://api.github.com/repos/sallyom/docker/issues{/number}","pulls_url":"https://api.github.com/repos/sallyom/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/sallyom/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/sallyom/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sallyom/docker/labels{/name}","releases_url":"https://api.github.com/repos/sallyom/docker/releases{/id}","created_at":"2015-05-28T16:19:24Z","updated_at":"2015-05-28T16:19:31Z","pushed_at":"2015-09-04T14:28:59Z","git_url":"git://github.com/sallyom/docker.git","ssh_url":"git@github.com:sallyom/docker.git","clone_url":"https://github.com/sallyom/docker.git","svn_url":"https://github.com/sallyom/docker","homepage":"http://www.docker.com","size":66869,"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":"8c5d511aa62098de73c35604947c361318225073","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-04T17:39:18Z","pushed_at":"2015-09-04T17:53:48Z","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":250372,"stargazers_count":24514,"watchers_count":24514,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6302,"mirror_url":null,"open_issues_count":1071,"forks":6302,"open_issues":1071,"watchers":24514,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/14012"},"html":{"href":"https://github.com/docker/docker/pull/14012"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/14012"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/14012/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/14012/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/14012/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/e806c7ee77ec1c132e7b69ec3d342caef92cd59a"}}}}