How to use nvm in a Docker image?

nvm is a great tool if you want to have multiple NodeJS versions . But what if you want to have nvm as a Docker image and use it?

Well, you can do something like this in your Dockerfile:

FROM debian:stable-slim

SHELL ["/bin/bash", "--login", "-c"]

RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
RUN curl --silent -o- | bash
RUN nvm install node # Install latest version

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *