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

Error: Unsupported architecture on Linux: arm64 #71

Open
dionjwa opened this issue Mar 15, 2024 · 3 comments
Open

Error: Unsupported architecture on Linux: arm64 #71

dionjwa opened this issue Mar 15, 2024 · 3 comments

Comments

@dionjwa
Copy link

dionjwa commented Mar 15, 2024

Problem

Environment:

On installing the @deno/kv package I get this runtime error

functions-1  | /opt/project/functions/node_modules/@deno/kv/script/_napi_index.cjs:100
functions-1  |         throw new Error(`Unsupported architecture on Linux: ${arch}`)
functions-1  |               ^
functions-1  |
functions-1  | Error: Unsupported architecture on Linux: arm64
functions-1  |     at Object.<anonymous> (/opt/project/functions/node_modules/@deno/kv/script/_napi_index.cjs:100:15)
functions-1  |     at Module._compile (node:internal/modules/cjs/loader:1256:14)

Looking into /opt/project/functions/node_modules/@deno/kv/script/_napi_index.cjs:100 then yes there is no matching package (linux/arm64)

This is the environment you can get in docker in macos.

Solution

Maybe add an automated build for linux/arm64

This architecture is also on e.g. raspberry pi devices.

@dbushell
Copy link

dbushell commented Mar 25, 2024

I was able to build the image on a Raspberry Pi 5:

git clone https://github.com/denoland/denokv.git
cd denokv
docker buildx build -f Dockerfile --platform linux/arm64 -t rpi5/denokv ./

Change rpi5/denokv to whatever image name you prefer.

Build took around 8 minutes.

On an M2 MacBook I've been using the linx/amd64 image with no problem. I get the warning:

denokv The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

but it still runs fine. Using Docker Desktop 4.28.0 on macOS 14.4. I did try building a native image (same command above) took a few minutes, haven't bothered to test it though.

Raspberry Pi 5:

Linux rpi5 6.6.20+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux

Docker version on Pi 5 (install guide):

Client: Docker Engine - Community
 Version:           26.0.0
 API version:       1.45
 Go version:        go1.21.8
 Git commit:        2ae903e
 Built:             Wed Mar 20 15:18:02 2024
 OS/Arch:           linux/arm64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.0.0
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.8
  Git commit:       8b79278
  Built:            Wed Mar 20 15:18:02 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Running fine on the Pi so far. I'll report back if any problems arise.

Official arm images would be nice now that Deno has offical arm binaries.

@dionjwa
Copy link
Author

dionjwa commented Mar 31, 2024

Yeah, it's the npm module @deno/kv that doesn't have the architecture. I am using the @deno/kv module from a node.js runtime. I don't have the ability to run my own docker image in this particular development setup, unfortunately.

@dionjwa
Copy link
Author

dionjwa commented Mar 31, 2024

But thanks for that example to create my own docker image.

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

No branches or pull requests

2 participants