From 2b81efb2c5e1aff05c8514903f80e31ff4aa0ca1 Mon Sep 17 00:00:00 2001 From: Cedric Verstraeten Date: Thu, 22 Sep 2022 19:30:37 +0200 Subject: [PATCH] fix node with nvm --- Dockerfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fc88411..5b99436 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,19 @@ COPY ui /go/src/github.com/kerberos-io/agent/ui ######################## # Download NPM and Yarns -RUN apt-get update && apt-get install -y curl && apt-get install -y nodejs && \ +RUN mkdir /usr/local/nvm +ENV NVM_DIR /usr/local/nvm +ENV NODE_VERSION 14.18.1 +RUN curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash \ + && . $NVM_DIR/nvm.sh \ + && nvm install $NODE_VERSION \ + && nvm alias default $NODE_VERSION \ + && nvm use default + +ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules +ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH + +RUN apt-get update && apt-get install -y curl && \ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ apt update && apt install yarn -y