Closed DJAlPee closed 5 months ago
Lots of things aren't installed by default on alpine, but they're required for use of nvm and/or node - all the "minimalism" of alpine seems to get erased once you add all the things your toolchain needs ¯\_(ツ)_/¯
The install script is bash-specific, so it won't work reliably on sh
. You could certainly set the BASH_VERSION
env var to a fake value before running the install script, but I wouldn't recommend it.
Coupling NVM to a specific shell is a bad idea. NVM already works for zsh on macs, why can't it support sh? Didn't it used to?
I currently can't find a documented way to install NVM in a docker image—which is a pretty common use case. This issue seems to be the limiting factor.
@robbyemmert nvm itself definitely works on sh
- the install script NEVER has worked reliably on anything but bash.
There's an official nvm docker image on dockerhub, and a Dockerfile in this repo: https://github.com/nvm-sh/nvm/blob/HEAD/Dockerfile
Operating system and version:
Using a hardened Alpine container image as base image for our CI/CD container image.
nvm debug
output:nvm ls
output:How did you install
nvm
?Create container image
What steps did you perform?
I updated VERSION_NVM from 0.39.1 to 0.39.2 (Patch version change!). Now
docker build
fails:Error: the install instructions explicitly say to pipe the install script to 'bash'; please follow them
. Changing the curl installation part fromsh
tobash
solved this issue, although I want to avoid usingbash
. Bash is not installed by default on Alpine and could be removed at any time from our hardened container image.This check had been introduced with this commit: https://github.com/nvm-sh/nvm/commit/39d9a42c359df5dbf37c5000af8192f14a280b94
The commands above had been executed, after sucessfull installation with
bash
.What did you expect to happen?
Usage of
sh
should still be possible, but maybe with a big warning message, that this is not the "official" way to install it.Is there anything in any of your profile files that modifies the
PATH
?Nope.
If you are having installation issues, or getting "N/A", what does
curl -I --compressed -v https://nodejs.org/dist/
print out?