Skip to content

Instantly share code, notes, and snippets.

@hailiang-wang
Created April 25, 2017 10:35
Show Gist options
  • Save hailiang-wang/780a0c352c86c27e36bf66e1a66508a0 to your computer and use it in GitHub Desktop.
Save hailiang-wang/780a0c352c86c27e36bf66e1a66508a0 to your computer and use it in GitHub Desktop.
Install nvm inside docker
# install dependencies
RUN apt-get update && apt-get install -y \
curl \
npm \
nodejs \
git;
# compatibility fix for node on ubuntu
RUN ln -s /usr/bin/nodejs /usr/bin/node;
# install nvm
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.24.1/install.sh | sh;
# invoke nvm to install node
RUN cp -f ~/.nvm/nvm.sh ~/.nvm/nvm-tmp.sh; \
echo "nvm install 0.12.2; nvm alias default 0.12.2" >> ~/.nvm/nvm-tmp.sh; \
sh ~/.nvm/nvm-tmp.sh; \
rm ~/.nvm/nvm-tmp.sh;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment