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

[Fix] recognize 32Bit docker container and use x86 arch #3051

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

ds82
Copy link
Contributor

@ds82 ds82 commented Mar 8, 2023

nvm tries to download & install 64Bit node Versions inside a 32Bit docker container on a 64Bit host

@ljharb
Copy link
Member

ljharb commented Mar 8, 2023

I'm confused, if you're inside a 32 bit container then it should read as 32bit.

(note that node itself doesn't support 32bit builds on non-windows, since like node 10)

@ds82
Copy link
Contributor Author

ds82 commented Mar 8, 2023

No, docker needs a 64Bit Host (and kernel) and the host kernel is used inside the container, even if that container is 32bit. A 64Bit kernel can run 32Bit code.

# on the host
 ❯❯❯ uname -m
x86_64

# switch to container
❯❯❯ docker run --rm -it titan-bullseye-386:latest /bin/bash
root@d149fca9a6c6:/# uname -m
x86_64
root@d149fca9a6c6:/# getconf LONG_BIT
32

There are still unofficial 32Bit builds:
https://unofficial-builds.nodejs.org/download/release/

And this URL can be used as MIRROR with nvm:
NVM_NODEJS_ORG_MIRROR=https://unofficial-builds.nodejs.org/download/release/

@ljharb
Copy link
Member

ljharb commented Mar 8, 2023

ah, gotcha. (relates to #3041)

@ljharb ljharb force-pushed the feat/recognize-32bit-docker branch from 0693d7f to dde04f9 Compare March 22, 2023 21:59
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we don't support unofficial builds, this seems narrow enough to be not as risky.

@ljharb ljharb merged commit dde04f9 into nvm-sh:master Mar 22, 2023
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

Successfully merging this pull request may close these issues.

2 participants