Created
April 25, 2022 13:09
-
-
Save abh006/e236bac293e7c5bc8213587bf46ec1da to your computer and use it in GitHub Desktop.
Dockerfile for Node image based on ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:20.04 | |
# Install Node | |
ENV NODE_VERSION=18.0.0 | |
RUN apt-get update && apt-get install -y curl | |
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash | |
ENV NVM_DIR=/root/.nvm | |
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} | |
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} | |
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} | |
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" | |
# Install Yarn | |
RUN apt-get install -y gnupg2 | |
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | |
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list | |
RUN apt-get update -qq && apt-get install -y yarn | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment