The code for installing node 14 on centos7 is:
RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash -
RUN yum -y install nodejs
How does it work? The first command downloads the package. Where does it get stored? How does the second command install nodejs from the downloaded package? Thanks.
What is the difference between putting bash and bash -
UPDATE: If someone came to this question searching for installing node in centos7, here is a code snippet that gets the exact version from NodeJS website.
RUN wget https://nodejs.org/download/release/v14.17.0/node-v14.17.0-linux-x64.tar.gz && \
tar xf node-v14.17.0-linux-x64.tar.gz -C /opt/ && \
rm node-v14.17.0-linux-x64.tar.gz
ENV PATH=/opt/node-v14.17.0-linux-x64/bin:$PATH
RUN npm config set cache /tmp --global
curlto look at it? You can browse to it here.