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

Fails to install node binary when running in docker on apple silicon #964

Open
mmmmmrob opened this issue Nov 29, 2021 · 3 comments
Open

Comments

@mmmmmrob
Copy link

Describe the bug
The buildpack fails while attempting to install node when running in docker on apple silicon.

The expected behaviour is that the binaries install correctly.

To Reproduce
Steps to reproduce the behavior:
On an apple silicon machine with docker desktop installed:

  1. Download the Dockerfile.txt
  2. Remove the .txt extension
  3. run docker build . --platform=linux/amd64
  4. See error fail.log

Versions (please complete the following information):

Additional context
Running heroku:20 and the buildpack in docker to create heroku-like runtime environment for local dev.

.

@mmmmmrob mmmmmrob added the bug label Nov 29, 2021
@joshwlewis
Copy link
Member

joshwlewis commented Dec 14, 2021

Yeah, it looks like we'll try to download the x64 binaries.

We really only support darwin so that we can test this buildpack locally. Nobody on the team has an M1 yet, so this isn't a big priority, though I'd entertain a PR.

It looks like the bug could be fixed by changing the architecture calculation here:

func getPlatform() string {
if runtime.GOOS == "darwin" {
return "darwin-x64"
}
return "linux-x64"
}

(It should return darwin-arm64 for M1 macs)

@jaygould
Copy link

jaygould commented Jan 26, 2022

Returning darwin-arm64 to the getPlatform() fn didn't solve this for me. Are there any other solutions?

@abarke
Copy link

abarke commented Nov 15, 2022

This would be really awesome to support multiple platforms. In our use cases specifically M1 and AWS Graviton architectures.

We use heroku buildpacks and can now deploy to AWS Graviton processors. If the buildpack was able to detect the platform and binary to install that would be incredible 😃

Or perhaps the simplest approach for now would be to set an environment variable like NODE_PLATFORM=linux-arm64 that would pull the node distribution for ARM v8 🚀

NODE_PLATFORM would then default to the existing platform binary. This would ensure backwards compatability.

Would this work? Any thoughts? @jmorrell @edmorley @joshwlewis 🤔

For those engineers who support Sustainable Engineering 🌞 and Green Software 🌳 this would be a big deal as this would allow engineers to deploy the same code on ARM, while boosting application performance, using less energy and reducing costs. A win-win for all 👏

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

4 participants