From f2e95154d136962cddcedf28fdebbbfb02ba68e5 Mon Sep 17 00:00:00 2001 From: John Cairns Date: Mon, 6 Nov 2023 14:31:18 -0600 Subject: [PATCH] 312: include Node 20.9.0 toolchain --- Dockerfile | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 32d057d36..04091b02b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ RUN useradd --create-home -s /bin/bash xmtp RUN usermod -a -G sudo xmtp -RUN echo '%xmtp ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers WORKDIR /rustup ## Rust @@ -42,7 +42,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt install -y -q --no-install-recommends \ ca-certificates apt-transport-https \ sudo ripgrep procps build-essential \ - python3 python3-pip python3-dev git && \ + python3 python3-pip python3-dev \ + git curl && \ apt clean && \ rm -rf /var/lib/apt/lists/* @@ -52,7 +53,25 @@ RUN useradd --create-home -s /bin/bash xmtp RUN usermod -a -G sudo xmtp RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers -## Rust +## Node and NPM +RUN mkdir -p /usr/local/nvm +ENV NVM_DIR=/usr/local/nvm + +ENV NODE_VERSION=v20.9.0 + +ADD https://raw.githubusercontent.com/creationix/nvm/master/install.sh /usr/local/etc/nvm/install.sh +RUN bash /usr/local/etc/nvm/install.sh && \ + bash -c ". $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm alias default $NODE_VERSION && nvm use default" + +ENV NVM_NODE_PATH ${NVM_DIR}/versions/node/${NODE_VERSION} +ENV NODE_PATH ${NVM_NODE_PATH}/lib/node_modules +ENV PATH ${NVM_NODE_PATH}/bin:$PATH + +RUN npm install npm -g +RUN npm install yarn -g + + +## Rust from builder COPY --chown=xmtp:xmtp --from=builder /home/xmtp/.cargo /home/xmtp/.cargo COPY --chown=xmtp:xmtp --from=builder /home/xmtp/.rustup /home/xmtp/.rustup