From e56801846b778c51fab653785a2e07f9abe31cd0 Mon Sep 17 00:00:00 2001 From: wanchia Date: Tue, 5 Sep 2017 11:06:53 +0800 Subject: [PATCH] add ENV PATH, fix the problem of docker-compose exec workspace npm(or other node-related script). --- workspace/Dockerfile-56 | 3 +++ workspace/Dockerfile-70 | 3 +++ workspace/Dockerfile-71 | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/workspace/Dockerfile-56 b/workspace/Dockerfile-56 index 5e775e54..46c72585 100644 --- a/workspace/Dockerfile-56 +++ b/workspace/Dockerfile-56 @@ -276,6 +276,9 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ ;fi +# Add PATH for node +ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin + ##################################### # YARN: ##################################### diff --git a/workspace/Dockerfile-70 b/workspace/Dockerfile-70 index 48443a2b..1f56aa0c 100644 --- a/workspace/Dockerfile-70 +++ b/workspace/Dockerfile-70 @@ -276,6 +276,9 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ ;fi +# Add PATH for node +ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin + ##################################### # YARN: ##################################### diff --git a/workspace/Dockerfile-71 b/workspace/Dockerfile-71 index cba070d5..915a9cf5 100644 --- a/workspace/Dockerfile-71 +++ b/workspace/Dockerfile-71 @@ -273,6 +273,10 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ ;fi +# Add PATH for node +ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin + + ##################################### # YARN: #####################################