Skip to content

Commit 894410a

Browse files
committed
mco: Use NVM instead of Node
1 parent 8f68b2c commit 894410a

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

Dockerfile

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,6 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2
2828
./aws/install && \
2929
rm -rf aws awscliv2.zip
3030

31-
# Install NodeJS
32-
ARG NODE_MAJOR=24
33-
34-
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
35-
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 && \
36-
apt-get update && apt-get install nodejs -y && \
37-
rm -rf /var/lib/apt/lists/* && \
38-
apt-get clean &&\
39-
npm install --global corepack &&\
40-
corepack enable
41-
4231
# Install Golang
4332
ARG GOLANG_VER=1.23.2
4433
RUN curl -fsSL https://go.dev/dl/go${GOLANG_VER}.linux-amd64.tar.gz | tar -C /usr/local -xz
@@ -52,9 +41,16 @@ WORKDIR ${HOME}
5241
RUN mkdir -p ${HOME}/go
5342
ENV PATH=${HOME}/go/bin:${PATH}
5443

55-
ENV PYENV_ROOT=${HOME}/.pyenv
44+
# Install NVM & Node
45+
ARG NODE_MAJOR=24
46+
ENV NVM_VERSION=v0.40.3
47+
ENV NVM_DIR="${HOME}/.nvm"
48+
RUN mkdir -p ${NVM_DIR} && \
49+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh | /bin/bash && \
50+
/bin/bash -c "source ${NVM_DIR}/nvm.sh && nvm install ${NODE_MAJOR}"
5651

5752
# Install Pyenv
53+
ENV PYENV_ROOT=${HOME}/.pyenv
5854
RUN git clone https://github.com/pyenv/pyenv.git ${PYENV_ROOT} && \
5955
cd ${PYENV_ROOT} && src/configure && make -C src
6056

@@ -79,4 +75,7 @@ RUN PYTHON_CONFIGURE_OPTS=--enable-shared pyenv install 3.9 && \
7975
ARG POETRY_VERSION=2.1.3
8076
RUN curl -sSL https://install.python-poetry.org | python3 - --version ${POETRY_VERSION}
8177

78+
# set ENTRYPOINT for reloading nvm-environment
79+
ENTRYPOINT ["/bin/bash", "-c", "source $NVM_DIR/nvm.sh && exec \"$@\"", "--"]
80+
8281
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)