ENV variable isn't added correctly to the container environment
Here is my
FROM ubuntu:latest MAINTAINER mazzy WORKDIR /tmp RUN apt-get update && apt-get install -y wget RUN wget http://nodejs.org/dist/v0.12.0/node-v0.12.0-linux-x64.tar.gz RUN tar xvf node-v0.12.0-linux-x64.tar.gz RUN cp -r node-v0.12.0-linux-x64 /usr/local/ WORKDIR /usr/local RUN ln -s /usr/local/node-v0.12.0-linux-x64.tar.gz /usr/local/node # FIX HERE ENV PATH /usr/local/node/bin:$PATH RUN npm install -g bower EXPOSE 8080:8080
The problem with this Dockerfile is that when I run it I got the error npm not found. This is probably caused by the fact that the installation folder isn’t added correctly to the PATH env variable.
Do you know why?
One Solution collect form web for “ENV variable isn't added correctly to the container environment”
Your created symlink is invalid. Your
/usr/local/node is pointing to a non existing file. You have to leave out the
Apart from that I recommend using the
node:onbuild docker image as your basis. It was created as a building block for your own node application and already includes a proper setup of node.js and npm.