{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/12448","labels_url":"https://api.github.com/repos/docker/docker/issues/12448/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/12448/comments","events_url":"https://api.github.com/repos/docker/docker/issues/12448/events","html_url":"https://github.com/docker/docker/issues/12448","id":68975578,"number":12448,"title":"Docker should return the exit code of commands terminated by signal","user":{"login":"metcalfc","id":31925,"avatar_url":"https://avatars.githubusercontent.com/u/31925?v=3","gravatar_id":"","url":"https://api.github.com/users/metcalfc","html_url":"https://github.com/metcalfc","followers_url":"https://api.github.com/users/metcalfc/followers","following_url":"https://api.github.com/users/metcalfc/following{/other_user}","gists_url":"https://api.github.com/users/metcalfc/gists{/gist_id}","starred_url":"https://api.github.com/users/metcalfc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metcalfc/subscriptions","organizations_url":"https://api.github.com/users/metcalfc/orgs","repos_url":"https://api.github.com/users/metcalfc/repos","events_url":"https://api.github.com/users/metcalfc/events{/privacy}","received_events_url":"https://api.github.com/users/metcalfc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-16T17:48:06Z","updated_at":"2015-04-16T18:01:57Z","closed_at":null,"body":"#354 appears to have fixed this for exit codes with commands that exit cleanly. #6734 seems to be focused on delineating between the docker command exit status and the command exit status.\r\n\r\nClean exits work as expected:\r\n\r\n```\r\n$ docker run debian:latest  /usr/bin/perl -e 'exit 1'\r\n$ echo $?\r\n1\r\n```\r\n\r\nIf my process gets killed I expect an error code to match:\r\n\r\n```\r\n$  /usr/bin/perl -e 'kill -9,$$'\r\n[1]    73715 killed     /usr/bin/perl -e 'kill -9,$$'\r\n$  echo $?\r\n137\r\n```\r\n\r\nBut that isn't the case in a container:\r\n\r\n```\r\n$  docker run debian:latest  /usr/bin/perl -e 'kill -9,$$'\r\n$  echo $?\r\n0\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/93803366","html_url":"https://github.com/docker/docker/issues/12448#issuecomment-93803366","issue_url":"https://api.github.com/repos/docker/docker/issues/12448","id":93803366,"user":{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars.githubusercontent.com/u/799078?v=3","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false},"created_at":"2015-04-16T18:01:57Z","updated_at":"2015-04-16T18:01:57Z","body":"I'm not sure what perl itself is doing here, but you can't send SIGKILL to pid 1, which is what your perl process is running as.\r\nIf you look at the output of `docker ps -a`, the captured exit code is indeed 0."}}