Created
July 12, 2018 18:42
-
-
Save lmakarov/e3eb4e7be620f0bba9ee32f5f133b36f to your computer and use it in GitHub Desktop.
Node.js via NVM manual installation in Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Node.js via NVM | |
ENV \ | |
NVM_VERSION=0.33.11 \ | |
NODE_VERSION=8.11.3 | |
# Don't use -x here - node/nvm print just too much stuff | |
RUN set -e; \ | |
# Manual nvm installation | |
NVM_DIR="$HOME/.nvm"; \ | |
PROFILE="$HOME/.profile"; \ | |
git clone --branch "v$NVM_VERSION" --depth 1 https://github.com/creationix/nvm.git "$NVM_DIR"; \ | |
echo >> "$PROFILE"; \ | |
echo 'export NVM_DIR="$HOME/.nvm"' >> "$PROFILE"; \ | |
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> "$PROFILE"; \ | |
echo '[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> "$PROFILE"; | |
# Load nvm and install the default nodejs version | |
. $NVM_DIR/nvm.sh; \ | |
nvm install $NODE_VERSION; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment