Skip to content

Commit

Permalink
Add nvm and node 18
Browse files Browse the repository at this point in the history
  • Loading branch information
argotriwidodo committed Jul 22, 2024
1 parent 0a21c9f commit c4183b8
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM ubuntu:22.04
LABEL org.opencontainers.image.authors="Badak Team Blibli.com <[email protected]>"
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

ARG VERSION=4.9
ARG user=jenkins
Expand All @@ -12,11 +13,18 @@ ARG gid=1000
RUN apt-get update
RUN apt-get -y upgrade
RUN apt install -y git
RUN apt-get install -y curl && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
RUN export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
RUN [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
RUN nvm install 18
RUN nvm use 18
RUN apt-get install -y curl
# nvm environment variables
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 18
RUN mkdir /usr/local/nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# install node and npm
RUN source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default

RUN apt-get install -y build-essential

# Install a basic SSH server
Expand Down

0 comments on commit c4183b8

Please sign in to comment.