{"action":"created","comment":{"url":"https://api.github.com/repos/dcos/dcos/pulls/comments/77884717","id":77884717,"diff_hunk":"@@ -48,6 +48,13 @@ def run(self, cmd):\n         docker.append(self.container)\n         docker += cmd\n         check_call(docker)\n+        DockerCmd.clean()\n+\n+    @staticmethod\n+    def clean():\n+        \"\"\"Removes the last container that was spawned\"\"\"\n+        container_id = check_output([\"docker\", \"ps\", \"--latest\", \"-q\"]).rstrip()\n+        check_call([\"docker\", \"rm\", \"-v\", container_id])","path":"pkgpanda/build/__init__.py","position":10,"original_position":10,"commit_id":"2e788ab02480b01c6c1e1fee142574e1841f76f2","original_commit_id":"2e788ab02480b01c6c1e1fee142574e1841f76f2","user":{"login":"aaronjwood","id":446283,"avatar_url":"https://avatars.githubusercontent.com/u/446283?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronjwood","html_url":"https://github.com/aaronjwood","followers_url":"https://api.github.com/users/aaronjwood/followers","following_url":"https://api.github.com/users/aaronjwood/following{/other_user}","gists_url":"https://api.github.com/users/aaronjwood/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronjwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronjwood/subscriptions","organizations_url":"https://api.github.com/users/aaronjwood/orgs","repos_url":"https://api.github.com/users/aaronjwood/repos","events_url":"https://api.github.com/users/aaronjwood/events{/privacy}","received_events_url":"https://api.github.com/users/aaronjwood/received_events","type":"User","site_admin":false},"body":"@cmaloney would you want to do a `-f` here as well?","created_at":"2016-09-07T19:07:53Z","updated_at":"2016-09-07T19:07:53Z","html_url":"https://github.com/dcos/dcos/pull/674#discussion_r77884717","pull_request_url":"https://api.github.com/repos/dcos/dcos/pulls/674","_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos/pulls/comments/77884717"},"html":{"href":"https://github.com/dcos/dcos/pull/674#discussion_r77884717"},"pull_request":{"href":"https://api.github.com/repos/dcos/dcos/pulls/674"}}},"pull_request":{"url":"https://api.github.com/repos/dcos/dcos/pulls/674","id":84343635,"html_url":"https://github.com/dcos/dcos/pull/674","diff_url":"https://github.com/dcos/dcos/pull/674.diff","patch_url":"https://github.com/dcos/dcos/pull/674.patch","issue_url":"https://api.github.com/repos/dcos/dcos/issues/674","number":674,"state":"open","locked":false,"title":"Cleanup containers","user":{"login":"aaronjwood","id":446283,"avatar_url":"https://avatars.githubusercontent.com/u/446283?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronjwood","html_url":"https://github.com/aaronjwood","followers_url":"https://api.github.com/users/aaronjwood/followers","following_url":"https://api.github.com/users/aaronjwood/following{/other_user}","gists_url":"https://api.github.com/users/aaronjwood/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronjwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronjwood/subscriptions","organizations_url":"https://api.github.com/users/aaronjwood/orgs","repos_url":"https://api.github.com/users/aaronjwood/repos","events_url":"https://api.github.com/users/aaronjwood/events{/privacy}","received_events_url":"https://api.github.com/users/aaronjwood/received_events","type":"User","site_admin":false},"body":"Figured this would be good to have in place so that we don't leave 200+ exited containers lying around after each build.","created_at":"2016-09-07T17:42:45Z","updated_at":"2016-09-07T19:07:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c61bbd0e136ceb34d32bd5a5f4033e5034970dc7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dcos/dcos/pulls/674/commits","review_comments_url":"https://api.github.com/repos/dcos/dcos/pulls/674/comments","review_comment_url":"https://api.github.com/repos/dcos/dcos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dcos/dcos/issues/674/comments","statuses_url":"https://api.github.com/repos/dcos/dcos/statuses/2e788ab02480b01c6c1e1fee142574e1841f76f2","head":{"label":"aaronjwood:cleanup-containers","ref":"cleanup-containers","sha":"2e788ab02480b01c6c1e1fee142574e1841f76f2","user":{"login":"aaronjwood","id":446283,"avatar_url":"https://avatars.githubusercontent.com/u/446283?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronjwood","html_url":"https://github.com/aaronjwood","followers_url":"https://api.github.com/users/aaronjwood/followers","following_url":"https://api.github.com/users/aaronjwood/following{/other_user}","gists_url":"https://api.github.com/users/aaronjwood/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronjwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronjwood/subscriptions","organizations_url":"https://api.github.com/users/aaronjwood/orgs","repos_url":"https://api.github.com/users/aaronjwood/repos","events_url":"https://api.github.com/users/aaronjwood/events{/privacy}","received_events_url":"https://api.github.com/users/aaronjwood/received_events","type":"User","site_admin":false},"repo":{"id":66664874,"name":"dcos","full_name":"aaronjwood/dcos","owner":{"login":"aaronjwood","id":446283,"avatar_url":"https://avatars.githubusercontent.com/u/446283?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronjwood","html_url":"https://github.com/aaronjwood","followers_url":"https://api.github.com/users/aaronjwood/followers","following_url":"https://api.github.com/users/aaronjwood/following{/other_user}","gists_url":"https://api.github.com/users/aaronjwood/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronjwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronjwood/subscriptions","organizations_url":"https://api.github.com/users/aaronjwood/orgs","repos_url":"https://api.github.com/users/aaronjwood/repos","events_url":"https://api.github.com/users/aaronjwood/events{/privacy}","received_events_url":"https://api.github.com/users/aaronjwood/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aaronjwood/dcos","description":"DC/OS Build and Release tools","fork":true,"url":"https://api.github.com/repos/aaronjwood/dcos","forks_url":"https://api.github.com/repos/aaronjwood/dcos/forks","keys_url":"https://api.github.com/repos/aaronjwood/dcos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aaronjwood/dcos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aaronjwood/dcos/teams","hooks_url":"https://api.github.com/repos/aaronjwood/dcos/hooks","issue_events_url":"https://api.github.com/repos/aaronjwood/dcos/issues/events{/number}","events_url":"https://api.github.com/repos/aaronjwood/dcos/events","assignees_url":"https://api.github.com/repos/aaronjwood/dcos/assignees{/user}","branches_url":"https://api.github.com/repos/aaronjwood/dcos/branches{/branch}","tags_url":"https://api.github.com/repos/aaronjwood/dcos/tags","blobs_url":"https://api.github.com/repos/aaronjwood/dcos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aaronjwood/dcos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aaronjwood/dcos/git/refs{/sha}","trees_url":"https://api.github.com/repos/aaronjwood/dcos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aaronjwood/dcos/statuses/{sha}","languages_url":"https://api.github.com/repos/aaronjwood/dcos/languages","stargazers_url":"https://api.github.com/repos/aaronjwood/dcos/stargazers","contributors_url":"https://api.github.com/repos/aaronjwood/dcos/contributors","subscribers_url":"https://api.github.com/repos/aaronjwood/dcos/subscribers","subscription_url":"https://api.github.com/repos/aaronjwood/dcos/subscription","commits_url":"https://api.github.com/repos/aaronjwood/dcos/commits{/sha}","git_commits_url":"https://api.github.com/repos/aaronjwood/dcos/git/commits{/sha}","comments_url":"https://api.github.com/repos/aaronjwood/dcos/comments{/number}","issue_comment_url":"https://api.github.com/repos/aaronjwood/dcos/issues/comments{/number}","contents_url":"https://api.github.com/repos/aaronjwood/dcos/contents/{+path}","compare_url":"https://api.github.com/repos/aaronjwood/dcos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aaronjwood/dcos/merges","archive_url":"https://api.github.com/repos/aaronjwood/dcos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aaronjwood/dcos/downloads","issues_url":"https://api.github.com/repos/aaronjwood/dcos/issues{/number}","pulls_url":"https://api.github.com/repos/aaronjwood/dcos/pulls{/number}","milestones_url":"https://api.github.com/repos/aaronjwood/dcos/milestones{/number}","notifications_url":"https://api.github.com/repos/aaronjwood/dcos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aaronjwood/dcos/labels{/name}","releases_url":"https://api.github.com/repos/aaronjwood/dcos/releases{/id}","deployments_url":"https://api.github.com/repos/aaronjwood/dcos/deployments","created_at":"2016-08-26T17:00:30Z","updated_at":"2016-08-26T17:00:31Z","pushed_at":"2016-09-07T19:05:54Z","git_url":"git://github.com/aaronjwood/dcos.git","ssh_url":"git@github.com:aaronjwood/dcos.git","clone_url":"https://github.com/aaronjwood/dcos.git","svn_url":"https://github.com/aaronjwood/dcos","homepage":"https://dcos.io","size":1615,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"dcos:master","ref":"master","sha":"973fc560c689c0b3aa658fb255f53e349719acfc","user":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":56184050,"name":"dcos","full_name":"dcos/dcos","owner":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dcos/dcos","description":"DC/OS Build and Release tools","fork":false,"url":"https://api.github.com/repos/dcos/dcos","forks_url":"https://api.github.com/repos/dcos/dcos/forks","keys_url":"https://api.github.com/repos/dcos/dcos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/dcos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/dcos/teams","hooks_url":"https://api.github.com/repos/dcos/dcos/hooks","issue_events_url":"https://api.github.com/repos/dcos/dcos/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/dcos/events","assignees_url":"https://api.github.com/repos/dcos/dcos/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/dcos/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/dcos/tags","blobs_url":"https://api.github.com/repos/dcos/dcos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/dcos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/dcos/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/dcos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/dcos/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/dcos/languages","stargazers_url":"https://api.github.com/repos/dcos/dcos/stargazers","contributors_url":"https://api.github.com/repos/dcos/dcos/contributors","subscribers_url":"https://api.github.com/repos/dcos/dcos/subscribers","subscription_url":"https://api.github.com/repos/dcos/dcos/subscription","commits_url":"https://api.github.com/repos/dcos/dcos/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/dcos/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/dcos/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/dcos/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/dcos/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/dcos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/dcos/merges","archive_url":"https://api.github.com/repos/dcos/dcos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/dcos/downloads","issues_url":"https://api.github.com/repos/dcos/dcos/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/dcos/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/dcos/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/dcos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/dcos/labels{/name}","releases_url":"https://api.github.com/repos/dcos/dcos/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/dcos/deployments","created_at":"2016-04-13T20:31:58Z","updated_at":"2016-09-07T11:33:15Z","pushed_at":"2016-09-07T19:05:55Z","git_url":"git://github.com/dcos/dcos.git","ssh_url":"git@github.com:dcos/dcos.git","clone_url":"https://github.com/dcos/dcos.git","svn_url":"https://github.com/dcos/dcos","homepage":"https://dcos.io","size":2424,"stargazers_count":844,"watchers_count":844,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":148,"mirror_url":null,"open_issues_count":38,"forks":148,"open_issues":38,"watchers":844,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos/pulls/674"},"html":{"href":"https://github.com/dcos/dcos/pull/674"},"issue":{"href":"https://api.github.com/repos/dcos/dcos/issues/674"},"comments":{"href":"https://api.github.com/repos/dcos/dcos/issues/674/comments"},"review_comments":{"href":"https://api.github.com/repos/dcos/dcos/pulls/674/comments"},"review_comment":{"href":"https://api.github.com/repos/dcos/dcos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dcos/dcos/pulls/674/commits"},"statuses":{"href":"https://api.github.com/repos/dcos/dcos/statuses/2e788ab02480b01c6c1e1fee142574e1841f76f2"}}}}
{"actor":{"display_login":"aaronjwood"}}