{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/source-to-image/pulls/comments/56504207","id":56504207,"diff_hunk":"@@ -126,6 +126,62 @@ type RunContainerOptions struct {\n \tCapDrop          []string\n }\n \n+// asDockerConfig converts a RunContainerOptions into a Config understood by the\n+// docker client library.\n+func (rco RunContainerOptions) asDockerConfig() docker.Config {\n+\treturn docker.Config{\n+\t\tImage: getImageName(rco.Image),\n+\t\tUser:  rco.User,\n+\t\t// TODO why do we call runContainerTar with a \"partial\"\n+\t\t// docker.Config?\n+\n+\t\tEnv: rco.Env,\n+\n+\t\t// TODO review how callers use these options to pass stdin.\n+\t\t// Probably they are not necessary, as they're related to\n+\t\t// attaching to the container (that is often unnecessary).","path":"pkg/docker/docker.go","position":17,"original_position":17,"commit_id":"f249b6dabbbe9002c87e9e69d73a5b86bd4325bd","original_commit_id":"f249b6dabbbe9002c87e9e69d73a5b86bd4325bd","user":{"login":"rhcarvalho","id":88819,"avatar_url":"https://avatars.githubusercontent.com/u/88819?v=3","gravatar_id":"","url":"https://api.github.com/users/rhcarvalho","html_url":"https://github.com/rhcarvalho","followers_url":"https://api.github.com/users/rhcarvalho/followers","following_url":"https://api.github.com/users/rhcarvalho/following{/other_user}","gists_url":"https://api.github.com/users/rhcarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcarvalho/subscriptions","organizations_url":"https://api.github.com/users/rhcarvalho/orgs","repos_url":"https://api.github.com/users/rhcarvalho/repos","events_url":"https://api.github.com/users/rhcarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/rhcarvalho/received_events","type":"User","site_admin":false},"body":"> (so we can see the logs)\r\n\r\nThis part is what I have shared previously when I implemented `runDocker` in origin, we don't need to attach anything to stream logs. It's much simpler to have a single goroutine calling the log api:\r\nhttps://github.com/openshift/origin/blob/000489d894c9b54b749fbf9246d4d218197a7280/pkg/build/builder/dockerutil.go#L146-L193\r\n\r\n> presumably we'd want to attach stderr when running save-artifacts in case the save-artifacts script uses it.\r\n\r\nAgain, we can stream stderr using the logs api.\r\n\r\n\r\n\r\n> yeah so basically we need to attach stdin for assemble (to stream in the content).\r\n\r\nI believe we don't need to \"attach\" stdin to send content, it should be enough to set the Stdin field when creating the container. Needs confirmation.","created_at":"2016-03-17T13:38:38Z","updated_at":"2016-03-17T13:38:38Z","html_url":"https://github.com/openshift/source-to-image/pull/430#discussion_r56504207","pull_request_url":"https://api.github.com/repos/openshift/source-to-image/pulls/430","_links":{"self":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/comments/56504207"},"html":{"href":"https://github.com/openshift/source-to-image/pull/430#discussion_r56504207"},"pull_request":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/430"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/source-to-image/pulls/430","id":63220394,"html_url":"https://github.com/openshift/source-to-image/pull/430","diff_url":"https://github.com/openshift/source-to-image/pull/430.diff","patch_url":"https://github.com/openshift/source-to-image/pull/430.patch","issue_url":"https://api.github.com/repos/openshift/source-to-image/issues/430","number":430,"state":"open","locked":false,"title":"WIP Rework RunContainer implementation","user":{"login":"rhcarvalho","id":88819,"avatar_url":"https://avatars.githubusercontent.com/u/88819?v=3","gravatar_id":"","url":"https://api.github.com/users/rhcarvalho","html_url":"https://github.com/rhcarvalho","followers_url":"https://api.github.com/users/rhcarvalho/followers","following_url":"https://api.github.com/users/rhcarvalho/following{/other_user}","gists_url":"https://api.github.com/users/rhcarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcarvalho/subscriptions","organizations_url":"https://api.github.com/users/rhcarvalho/orgs","repos_url":"https://api.github.com/users/rhcarvalho/repos","events_url":"https://api.github.com/users/rhcarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/rhcarvalho/received_events","type":"User","site_admin":false},"body":"The objective is to fix concurrency issues with the current implementation.\r\n\r\nFixes https://bugzilla.redhat.com/show_bug.cgi?id=1315607.","created_at":"2016-03-17T13:14:49Z","updated_at":"2016-03-17T13:38:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d20bc24f60c5119f5cb962280014261219c2f6b2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/source-to-image/pulls/430/commits","review_comments_url":"https://api.github.com/repos/openshift/source-to-image/pulls/430/comments","review_comment_url":"https://api.github.com/repos/openshift/source-to-image/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/source-to-image/issues/430/comments","statuses_url":"https://api.github.com/repos/openshift/source-to-image/statuses/f249b6dabbbe9002c87e9e69d73a5b86bd4325bd","head":{"label":"rhcarvalho:bz1315607-run-container-incr-build","ref":"bz1315607-run-container-incr-build","sha":"f249b6dabbbe9002c87e9e69d73a5b86bd4325bd","user":{"login":"rhcarvalho","id":88819,"avatar_url":"https://avatars.githubusercontent.com/u/88819?v=3","gravatar_id":"","url":"https://api.github.com/users/rhcarvalho","html_url":"https://github.com/rhcarvalho","followers_url":"https://api.github.com/users/rhcarvalho/followers","following_url":"https://api.github.com/users/rhcarvalho/following{/other_user}","gists_url":"https://api.github.com/users/rhcarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcarvalho/subscriptions","organizations_url":"https://api.github.com/users/rhcarvalho/orgs","repos_url":"https://api.github.com/users/rhcarvalho/repos","events_url":"https://api.github.com/users/rhcarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/rhcarvalho/received_events","type":"User","site_admin":false},"repo":{"id":30884626,"name":"source-to-image","full_name":"rhcarvalho/source-to-image","owner":{"login":"rhcarvalho","id":88819,"avatar_url":"https://avatars.githubusercontent.com/u/88819?v=3","gravatar_id":"","url":"https://api.github.com/users/rhcarvalho","html_url":"https://github.com/rhcarvalho","followers_url":"https://api.github.com/users/rhcarvalho/followers","following_url":"https://api.github.com/users/rhcarvalho/following{/other_user}","gists_url":"https://api.github.com/users/rhcarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcarvalho/subscriptions","organizations_url":"https://api.github.com/users/rhcarvalho/orgs","repos_url":"https://api.github.com/users/rhcarvalho/repos","events_url":"https://api.github.com/users/rhcarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/rhcarvalho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rhcarvalho/source-to-image","description":"A tool for building/building artifacts from source and injecting into docker images","fork":true,"url":"https://api.github.com/repos/rhcarvalho/source-to-image","forks_url":"https://api.github.com/repos/rhcarvalho/source-to-image/forks","keys_url":"https://api.github.com/repos/rhcarvalho/source-to-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhcarvalho/source-to-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhcarvalho/source-to-image/teams","hooks_url":"https://api.github.com/repos/rhcarvalho/source-to-image/hooks","issue_events_url":"https://api.github.com/repos/rhcarvalho/source-to-image/issues/events{/number}","events_url":"https://api.github.com/repos/rhcarvalho/source-to-image/events","assignees_url":"https://api.github.com/repos/rhcarvalho/source-to-image/assignees{/user}","branches_url":"https://api.github.com/repos/rhcarvalho/source-to-image/branches{/branch}","tags_url":"https://api.github.com/repos/rhcarvalho/source-to-image/tags","blobs_url":"https://api.github.com/repos/rhcarvalho/source-to-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhcarvalho/source-to-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhcarvalho/source-to-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhcarvalho/source-to-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhcarvalho/source-to-image/statuses/{sha}","languages_url":"https://api.github.com/repos/rhcarvalho/source-to-image/languages","stargazers_url":"https://api.github.com/repos/rhcarvalho/source-to-image/stargazers","contributors_url":"https://api.github.com/repos/rhcarvalho/source-to-image/contributors","subscribers_url":"https://api.github.com/repos/rhcarvalho/source-to-image/subscribers","subscription_url":"https://api.github.com/repos/rhcarvalho/source-to-image/subscription","commits_url":"https://api.github.com/repos/rhcarvalho/source-to-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhcarvalho/source-to-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhcarvalho/source-to-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhcarvalho/source-to-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/rhcarvalho/source-to-image/contents/{+path}","compare_url":"https://api.github.com/repos/rhcarvalho/source-to-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhcarvalho/source-to-image/merges","archive_url":"https://api.github.com/repos/rhcarvalho/source-to-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhcarvalho/source-to-image/downloads","issues_url":"https://api.github.com/repos/rhcarvalho/source-to-image/issues{/number}","pulls_url":"https://api.github.com/repos/rhcarvalho/source-to-image/pulls{/number}","milestones_url":"https://api.github.com/repos/rhcarvalho/source-to-image/milestones{/number}","notifications_url":"https://api.github.com/repos/rhcarvalho/source-to-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhcarvalho/source-to-image/labels{/name}","releases_url":"https://api.github.com/repos/rhcarvalho/source-to-image/releases{/id}","deployments_url":"https://api.github.com/repos/rhcarvalho/source-to-image/deployments","created_at":"2015-02-16T19:37:03Z","updated_at":"2016-02-08T10:58:07Z","pushed_at":"2016-03-17T13:13:13Z","git_url":"git://github.com/rhcarvalho/source-to-image.git","ssh_url":"git@github.com:rhcarvalho/source-to-image.git","clone_url":"https://github.com/rhcarvalho/source-to-image.git","svn_url":"https://github.com/rhcarvalho/source-to-image","homepage":"","size":2194,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"9fe0bf74dd7658364e202ecce2a28f8cb7f83f66","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":16323162,"name":"source-to-image","full_name":"openshift/source-to-image","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/source-to-image","description":"A tool for building/building artifacts from source and injecting into docker images","fork":false,"url":"https://api.github.com/repos/openshift/source-to-image","forks_url":"https://api.github.com/repos/openshift/source-to-image/forks","keys_url":"https://api.github.com/repos/openshift/source-to-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/source-to-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/source-to-image/teams","hooks_url":"https://api.github.com/repos/openshift/source-to-image/hooks","issue_events_url":"https://api.github.com/repos/openshift/source-to-image/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/source-to-image/events","assignees_url":"https://api.github.com/repos/openshift/source-to-image/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/source-to-image/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/source-to-image/tags","blobs_url":"https://api.github.com/repos/openshift/source-to-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/source-to-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/source-to-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/source-to-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/source-to-image/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/source-to-image/languages","stargazers_url":"https://api.github.com/repos/openshift/source-to-image/stargazers","contributors_url":"https://api.github.com/repos/openshift/source-to-image/contributors","subscribers_url":"https://api.github.com/repos/openshift/source-to-image/subscribers","subscription_url":"https://api.github.com/repos/openshift/source-to-image/subscription","commits_url":"https://api.github.com/repos/openshift/source-to-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/source-to-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/source-to-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/source-to-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/source-to-image/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/source-to-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/source-to-image/merges","archive_url":"https://api.github.com/repos/openshift/source-to-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/source-to-image/downloads","issues_url":"https://api.github.com/repos/openshift/source-to-image/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/source-to-image/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/source-to-image/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/source-to-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/source-to-image/labels{/name}","releases_url":"https://api.github.com/repos/openshift/source-to-image/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/source-to-image/deployments","created_at":"2014-01-28T19:32:40Z","updated_at":"2016-03-16T09:49:57Z","pushed_at":"2016-03-17T13:22:42Z","git_url":"git://github.com/openshift/source-to-image.git","ssh_url":"git@github.com:openshift/source-to-image.git","clone_url":"https://github.com/openshift/source-to-image.git","svn_url":"https://github.com/openshift/source-to-image","homepage":"","size":2278,"stargazers_count":206,"watchers_count":206,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":97,"mirror_url":null,"open_issues_count":18,"forks":97,"open_issues":18,"watchers":206,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/430"},"html":{"href":"https://github.com/openshift/source-to-image/pull/430"},"issue":{"href":"https://api.github.com/repos/openshift/source-to-image/issues/430"},"comments":{"href":"https://api.github.com/repos/openshift/source-to-image/issues/430/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/430/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/430/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/source-to-image/statuses/f249b6dabbbe9002c87e9e69d73a5b86bd4325bd"}}}}