{"action":"created","issue":{"url":"https://api.github.com/repos/github/hub/issues/1818","repository_url":"https://api.github.com/repos/github/hub","labels_url":"https://api.github.com/repos/github/hub/issues/1818/labels{/name}","comments_url":"https://api.github.com/repos/github/hub/issues/1818/comments","events_url":"https://api.github.com/repos/github/hub/issues/1818/events","html_url":"https://github.com/github/hub/issues/1818","id":344846107,"node_id":"MDU6SXNzdWUzNDQ4NDYxMDc=","number":1818,"title":"Problem with the linux binaries: \"/bin/sh: hub: not found\"","user":{"login":"philwinder","id":8793723,"node_id":"MDQ6VXNlcjg3OTM3MjM=","avatar_url":"https://avatars2.githubusercontent.com/u/8793723?v=4","gravatar_id":"","url":"https://api.github.com/users/philwinder","html_url":"https://github.com/philwinder","followers_url":"https://api.github.com/users/philwinder/followers","following_url":"https://api.github.com/users/philwinder/following{/other_user}","gists_url":"https://api.github.com/users/philwinder/gists{/gist_id}","starred_url":"https://api.github.com/users/philwinder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philwinder/subscriptions","organizations_url":"https://api.github.com/users/philwinder/orgs","repos_url":"https://api.github.com/users/philwinder/repos","events_url":"https://api.github.com/users/philwinder/events{/privacy}","received_events_url":"https://api.github.com/users/philwinder/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-07-26T13:33:35Z","updated_at":"2018-08-27T11:08:10Z","closed_at":"2018-07-31T13:54:52Z","author_association":"NONE","body":"Hi there. I wasn't able to download and install the linux binaries properly on Alpine linux.\r\n\r\nI've created a Dockerfile to recreate the problem.\r\n\r\n```Dockerfile\r\nFROM alpine:3.8\r\n\r\nRUN apk add --no-cache bash\r\n\r\nRUN wget --quiet https://github.com/github/hub/releases/download/v2.5.0/hub-linux-amd64-2.5.0.tgz -O hub.tgz ; \\\r\n    mkdir hub ; \\\r\n    tar -xvzf hub.tgz --directory hub --strip-components=1 ; \\\r\n    ./hub*/install\r\n\r\nRUN hub\r\n```\r\n\r\nIf you build this then you will get:\r\n\r\n```sh\r\ndocker build -t temp .\r\nSending build context to Docker daemon  2.048kB\r\nStep 1/4 : FROM alpine:3.8\r\n ---> 11cd0b38bc3c\r\nStep 2/4 : RUN apk add --no-cache bash\r\n ---> Using cache\r\n ---> b3d1d700abe2\r\nStep 3/4 : RUN wget --quiet https://github.com/github/hub/releases/download/v2.5.0/hub-linux-amd64-2.5.0.tgz -O hub.tgz ;     mkdir hub ;     tar -xvzf hub.tgz --directory hub --strip-components=1 ;     ./hub*/install\r\n ---> Running in a62f8f93e4e4\r\nhub-linux-amd64-2.5.0/\r\n\r\n...\r\n\r\nhub-linux-amd64-2.5.0/install\r\nRemoving intermediate container a62f8f93e4e4\r\n ---> d842b5922714\r\nStep 4/4 : RUN hub\r\n ---> Running in 83fcf019ef52\r\n/bin/sh: hub: not found\r\nThe command '/bin/sh -c hub' returned a non-zero code: 127\r\n```\r\n\r\nAs a workaround, I found that if I used the hub package in the alpine testing branch, that works. I.e.\r\n\r\n```Dockerfile\r\nRUN echo \"http://dl-cdn.alpinelinux.org/alpine/edge/testing\" >> /etc/apk/repositories\r\nRUN apk add --no-cache \\\r\n    git=2.18.0-r0 \\\r\n    bash=4.4.19-r1 \\\r\n    hub=2.4.0-r0\r\n```\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/github/hub/issues/comments/416192473","html_url":"https://github.com/github/hub/issues/1818#issuecomment-416192473","issue_url":"https://api.github.com/repos/github/hub/issues/1818","id":416192473,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjE5MjQ3Mw==","user":{"login":"mislav","id":887,"node_id":"MDQ6VXNlcjg4Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/887?v=4","gravatar_id":"","url":"https://api.github.com/users/mislav","html_url":"https://github.com/mislav","followers_url":"https://api.github.com/users/mislav/followers","following_url":"https://api.github.com/users/mislav/following{/other_user}","gists_url":"https://api.github.com/users/mislav/gists{/gist_id}","starred_url":"https://api.github.com/users/mislav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mislav/subscriptions","organizations_url":"https://api.github.com/users/mislav/orgs","repos_url":"https://api.github.com/users/mislav/repos","events_url":"https://api.github.com/users/mislav/events{/privacy}","received_events_url":"https://api.github.com/users/mislav/received_events","type":"User","site_admin":true},"created_at":"2018-08-27T11:08:10Z","updated_at":"2018-08-27T11:08:10Z","author_association":"MEMBER","body":"Thank you @philwinder @andyneff. I've also been reading https://medium.com/@diogok/on-golang-static-binaries-cross-compiling-and-plugins-1aed33499671 which suggests:\r\n\r\n```sh\r\nCGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a \\\r\n  -tags netgo -ldflags '-w -extldflags \"-static\"' -o mybin *.go\r\n```\r\n\r\nNow the question is, which precompiled builds should I apply these flags to? Or, should I make a separate precompiled build with these settings? When to instruct people in the install docs to try downloading that build?"}}
{"actor":{"display_login":"mislav"}}