To install Node in Dockerfile, we run curl
and apt-get
.
For instance, in our Dockerfile, we write
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y nodejs
to download the Node setup script with curl
and run it with bash
.
And then we run apt-get
to install nodejs
.