Skip to content

Instantly share code, notes, and snippets.

@nyteshade
Created January 23, 2024 21:48
Show Gist options
  • Save nyteshade/44c7c74240b67e38bbafa5b65a1cc3d9 to your computer and use it in GitHub Desktop.
Save nyteshade/44c7c74240b67e38bbafa5b65a1cc3d9 to your computer and use it in GitHub Desktop.
Getting NVM setup in a docker image
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN mkdir -p /usr/local/nvm
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 21.6.1
RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment