I am installing node v8.17.0(lts/carbon) through nvm, inside a container having java as base image. Im unable to find node
inside it when I run any commands through it
FROM openjdk:8-alpine
*some java logic*
RUN apk update && apk add bash curl
WORKDIR ./ui
#nvm is installed here
RUN mkdir /usr/local/nvm
ENV NVM_DIR /usr/local/nvm
#installing nvm as mentioned in official website
RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
RUN . /usr/local/nvm/nvm.sh && nvm install lts/carbon
ENV PATH "/usr/local/nvm/versions/node/v8.17.0/bin:$PATH"
lts/carbon is the version I require to run my other node application. But once I build the image and run shell inside container and try to do node -v
, I get node not found. Can anyone tell me where I am going wrong ?
FYI -> I took reference from this https://gist.github.com/remarkablemark/aacf14c29b3f01d6900d13137b21db3a
Below also does not seems to work for me