Last active
October 18, 2023 05:51
-
-
Save facundofarias/16667c2312693deafb48721a82e0d550 to your computer and use it in GitHub Desktop.
nodesource/distributions for Ubuntu on Docker
This file contains 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
# Installing node.js (16) and npm: https://github.com/nodesource/distributions | |
ENV NODE_MAJOR=16 | |
# 1. Download and import the Nodesource GPG key | |
RUN apt-get update | |
RUN apt-get install -y ca-certificates curl gnupg | |
RUN mkdir -p /etc/apt/keyrings | |
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg | |
# 2. Add the NodeSource package repositories for Debian-based distributions | |
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x focal main" | tee /etc/apt/sources.list.d/nodesource.list | |
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list | |
# 3. Install Node.js from the Debian-based distributions repository | |
RUN apt-get update | |
RUN apt-get install -y nodejs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment