Fixed nvm/node installation not working.

This commit is contained in:
Suteepat Damrongyingsupab 2016-08-11 18:03:27 +07:00
parent f12028576c
commit b393996d44

View File

@ -102,17 +102,11 @@ RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \
# Check if NVM needs to be installed # Check if NVM needs to be installed
ARG INSTALL_NODE=true ARG INSTALL_NODE=true
ENV INSTALL_NODE ${INSTALL_NODE} ENV INSTALL_NODE ${INSTALL_NODE}
ENV NVM_DIR /home/laradock/.nvm
RUN if [ ${INSTALL_NODE} = true ]; then \ RUN if [ ${INSTALL_NODE} = true ]; then \
# Install nvm (A Node Version Manager) # Install nvm (A Node Version Manager)
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash \ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash && \
;fi . ~/.nvm/nvm.sh && \
# Again check if NVM needs to be installed
# I had to split this condition link this because when I get it inside the above if statement is refuses to work!
ENV if [ ${INSTALL_NODE} = true ]; then \
# Set the ENV
NVM_DIR=/home/laradock/.nvm \
# Install NodeJS with NVM
RUN . ~/.nvm/nvm.sh && \
nvm install stable && \ nvm install stable && \
nvm use stable && \ nvm use stable && \
nvm alias stable && \ nvm alias stable && \