Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doctl binary for Android ARM64 #1028

Open
vainkop opened this issue Sep 5, 2021 · 3 comments
Open

doctl binary for Android ARM64 #1028

vainkop opened this issue Sep 5, 2021 · 3 comments

Comments

@vainkop
Copy link

vainkop commented Sep 5, 2021

There is no working doctl binary for Android ARM64 & I'd like to be able to use doctl on Android to manage Kubernetes clusters.

Currently I'm able to manage EKS, GKE with their tools like aws-iam-authenticator & gcloud but not DigitalOcean.

For example with the latest arm64 binary in the repo releases https://github.com/digitalocean/doctl/releases/download/v1.64.0/doctl-1.64.0-linux-arm64.tar.gz it doesn't work:

export DIGITALOCEAN_ACCESS_TOKEN="xxxxxxxxxxxxxx" && \
doctl auth init

Error: Unable to use supplied token to access API: Get https://api.digitalocean.com/v2/account: dial tcp lookup api.digitalocean.com on [::1]:53 read udp [::1]:47107>[::1]:53 read connection refused

But the curl request for same api works ok:

export DIGITALOCEAN_ACCESS_TOKEN="xxxxxxxxxxxxxx" && \
curl -X GET -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
"https://api.digitalocean.com/v2/account"

{
  "account":
    {
      "droplet_limit":xxxx,
      "floating_ip_limit":xx,
      "volume_limit":xxx,
      "email":"xxxxxx",
      "uuid":"xxxxxxxxx",
      "email_verified":true,
      "status":"active",
      "status_message":""
    }
}

I wasn't able to build a working binary from sources either.

@andrewsomething
Copy link
Member

Hi @vainkop Thanks for opening this issue. I suspect the DNS resolution failure you are seeing is due to this upstream issue with Go itself: golang/go#8877 I believe building doctl with cgo enabled should produce a working binary for Android. Though that would require building it on the target platform. We disable cgo on our build in order to cross-build for different architectures.

If you a have an Android environment with a functional Go setup, I think they should be able to build it there with:

cd cmd/doctl && CGO_ENABLED=1 go build

@vainkop
Copy link
Author

vainkop commented Sep 7, 2021

Hi @vainkop Thanks for opening this issue. I suspect the DNS resolution failure you are seeing is due to this upstream issue with Go itself: golang/go#8877 I believe building doctl with cgo enabled should produce a working binary for Android. Though that would require building it on the target platform. We disable cgo on our build in order to cross-build for different architectures.

If you a have an Android environment with a functional Go setup, I think they should be able to build it there with:

cd cmd/doctl && CGO_ENABLED=1 go build

@andrewsomething
Unfortunately I don't have an environment with android ndk & etc necessary for such builds.

Because this platform is quite popular please consider building Android binaries & putting them into release assets on a regular basis like for the rest of the platforms. I wouldn't like to go through the building process every time you release a new version.

Also posting some issues & link that others might find useful:
golang/go#8877
https://github.com/golang/go/wiki/Mobile

@createchange
Copy link

Hi @vainkop Thanks for opening this issue. I suspect the DNS resolution failure you are seeing is due to this upstream issue with Go itself: golang/go#8877 I believe building doctl with cgo enabled should produce a working binary for Android. Though that would require building it on the target platform. We disable cgo on our build in order to cross-build for different architectures.

If you a have an Android environment with a functional Go setup, I think they should be able to build it there with:

cd cmd/doctl && CGO_ENABLED=1 go build

Thank you for providing this information. I do have the prequisite environment, and was able to get a functional binary which now permits me to authenticate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants