Add support for multiple Node.js version
Closed this issue · 4 comments
Why not just build in nvm
to let users decide which version of node.js to install?
By default, the latest LTS version is installed in the image using nvm
, while user determines other versions when the image running.
If I understand correctly, the nvm
installs Node.js in the container runtime (exectue inside container) if users want to use a particular version.
If so, reinstallation is required every time the container is started, which takes time.
This proposal is about creating tags for each Node.js version, that is, there will only be one version of Node.js installed per tag out-of-box, but there is no plan to implement it, I may be overthinking it, the latest and LTS versions are sufficient for most cases.
@razonyang
Yes, you understand correctly, users need to install specific versions themselves.
In my opinion, there are many node versions, and non-LTS or non-latest versions are never the mainstream requirements. You can avoid more builds by providing them with an option.
If many people have this requirement, they can choose to build a downstream package to use a specific node version, instead of doing everything in one package. For example, users can use similar commands to package their own images:
FROM hugomods/hugo:exts as hugo
RUN nvm install 18.0.0;
&& nvm use 18.0.0
In my opinion, there are many node versions
Indeed, but I'm just going to create tags for the major version of Node.js.
The proposal doesn't seem very useful at the moment, users can create their own image, and nvm
won't be included into the image, users can easily install it with an extra RUN
instruction.