{"action":"created","issue":{"url":"https://api.github.com/repos/deis/prototype-repo/issues/6","labels_url":"https://api.github.com/repos/deis/prototype-repo/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/deis/prototype-repo/issues/6/comments","events_url":"https://api.github.com/repos/deis/prototype-repo/issues/6/events","html_url":"https://github.com/deis/prototype-repo/issues/6","id":118685115,"number":6,"title":"do builds in a separate container","user":{"login":"arschles","id":70865,"avatar_url":"https://avatars.githubusercontent.com/u/70865?v=3","gravatar_id":"","url":"https://api.github.com/users/arschles","html_url":"https://github.com/arschles","followers_url":"https://api.github.com/users/arschles/followers","following_url":"https://api.github.com/users/arschles/following{/other_user}","gists_url":"https://api.github.com/users/arschles/gists{/gist_id}","starred_url":"https://api.github.com/users/arschles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arschles/subscriptions","organizations_url":"https://api.github.com/users/arschles/orgs","repos_url":"https://api.github.com/users/arschles/repos","events_url":"https://api.github.com/users/arschles/events{/privacy}","received_events_url":"https://api.github.com/users/arschles/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/deis/prototype-repo/labels/proposal","name":"proposal","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-24T19:27:42Z","updated_at":"2015-11-30T19:57:12Z","closed_at":null,"body":"instead of building in the Dockerfile, build the binary in a separate container before running `docker build`, and copy the resulting binary into the image in the `Dockerfile`.\r\n\r\nthis command builds a binary that can run in `alpine:3.1` and most linux based containers:\r\n\r\n`docker run --rm -it -e GO15VENDOREXPERIMENT=1 -v $$GOPATH:/gopath -e GOPATH=/gopath -e CGO_ENABLED=0 -w /gopath/src/github.com/deis/PROJ_NAME golang:1.5.1 go build -o /gopath/src/github.com/deis/PROJ_NAME/BINARY_NAME -a -installsuffix cgo -ldflags ${LDFLAGS}`\r\n"},"comment":{"url":"https://api.github.com/repos/deis/prototype-repo/issues/comments/160741027","html_url":"https://github.com/deis/prototype-repo/issues/6#issuecomment-160741027","issue_url":"https://api.github.com/repos/deis/prototype-repo/issues/6","id":160741027,"user":{"login":"technosophos","id":89193,"avatar_url":"https://avatars.githubusercontent.com/u/89193?v=3","gravatar_id":"","url":"https://api.github.com/users/technosophos","html_url":"https://github.com/technosophos","followers_url":"https://api.github.com/users/technosophos/followers","following_url":"https://api.github.com/users/technosophos/following{/other_user}","gists_url":"https://api.github.com/users/technosophos/gists{/gist_id}","starred_url":"https://api.github.com/users/technosophos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technosophos/subscriptions","organizations_url":"https://api.github.com/users/technosophos/orgs","repos_url":"https://api.github.com/users/technosophos/repos","events_url":"https://api.github.com/users/technosophos/events{/privacy}","received_events_url":"https://api.github.com/users/technosophos/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T19:57:12Z","updated_at":"2015-11-30T19:57:12Z","body":"I'm nor clear what this is fixing. Which target does this belong in?\r\n\r\nIIRC, what currently happens is that a new docker container is run and it runs `make docker-build` or something like that inside of the container, then leaves the artifact on disk. That seems to me to be a little easier to maintain than a single-line version that (it looks like) does about the same thing.\r\n\r\nThe idea was to make it easy to modify the `docker-build` target for other builds."}}