The problem is that when the container is launched the ~/.nvm/nvm.sh file is not sourced anymore (only in your install)
In this Dockerfile I’ve exported that source command to ~/.bashrc and set the default command to /bin/bash. Then when you launch the container the nvm command is available
FROM ubuntu:14.10
RUN apt-get update && apt-get install -y curl git
RUN git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
RUN /bin/bash -c "source ~/.nvm/nvm.sh && nvm install 0.10"
RUN echo ". ~/.nvm/nvm.sh" >> ~/.bashrc
CMD ["/bin/bash"]
After you launch a container you’ll need to specify which version you want to use:
root@4589f35e3cc9:/# nvm use 0.10
Now using node v0.10.39 (npm v1.4.28)
root@4589f35e3cc9:/# node -v
v0.10.39