mirror of https://github.com/aminya/setup-cpp
ci: fix node install with nvm
This commit is contained in:
parent
d9316c0cbc
commit
bfe7d5afde
|
@ -4,11 +4,21 @@ FROM ubuntu:20.04 as base
|
||||||
ENV TZ=Canada/Pacific
|
ENV TZ=Canada/Pacific
|
||||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
|
# install node with nvm
|
||||||
|
RUN apt-get update -qq && apt-get install -y --no-install-recommends git curl wget ca-certificates
|
||||||
ARG nvm_version="0.39.3"
|
ARG nvm_version="0.39.3"
|
||||||
ARG node_version="16.20.0"
|
ARG node_version="16.20.0"
|
||||||
RUN touch ~/.bashrc && chmod +x ~/.bashrc
|
RUN mkdir /usr/local/nvm
|
||||||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v${nvm_version}/install.sh | bash
|
ENV NVM_DIR /usr/local/nvm
|
||||||
RUN source ~/.nvm/nvm.sh && nvm install ${node_version}
|
ADD https://raw.githubusercontent.com/nvm-sh/nvm/v${nvm_version}/install.sh /nvm_install.sh
|
||||||
|
RUN chmod +x /nvm_install.sh && /nvm_install.sh \
|
||||||
|
&& . $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
|
||||||
|
|
||||||
|
|
||||||
# add setup-cpp.js
|
# add setup-cpp.js
|
||||||
COPY "./dist/node16" "/"
|
COPY "./dist/node16" "/"
|
||||||
|
|
|
@ -4,10 +4,20 @@ FROM ubuntu:20.04 as base
|
||||||
ENV TZ=Canada/Pacific
|
ENV TZ=Canada/Pacific
|
||||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
|
# install node with nvm
|
||||||
|
RUN apt-get update -qq && apt-get install -y --no-install-recommends git curl wget ca-certificates
|
||||||
ARG nvm_version="0.39.3"
|
ARG nvm_version="0.39.3"
|
||||||
RUN touch ~/.bashrc && chmod +x ~/.bashrc
|
ARG node_version="12.22.12"
|
||||||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v${nvm_version}/install.sh | bash
|
RUN mkdir /usr/local/nvm
|
||||||
RUN source ~/.nvm/nvm.sh && nvm install 12
|
ENV NVM_DIR /usr/local/nvm
|
||||||
|
ADD https://raw.githubusercontent.com/nvm-sh/nvm/v${nvm_version}/install.sh /nvm_install.sh
|
||||||
|
RUN chmod +x /nvm_install.sh && /nvm_install.sh \
|
||||||
|
&& . $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
|
||||||
|
|
||||||
# add setup-cpp.js
|
# add setup-cpp.js
|
||||||
COPY "./dist/node12" "/"
|
COPY "./dist/node12" "/"
|
||||||
|
|
|
@ -1,14 +1,23 @@
|
||||||
FROM ubuntu:20.04 as base
|
FROM ubuntu:22.04 as base
|
||||||
|
|
||||||
# set time-zone
|
# set time-zone
|
||||||
ENV TZ=Canada/Pacific
|
ENV TZ=Canada/Pacific
|
||||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
|
# install node with nvm
|
||||||
|
RUN apt-get update -qq && apt-get install -y --no-install-recommends git curl wget ca-certificates
|
||||||
ARG nvm_version="0.39.3"
|
ARG nvm_version="0.39.3"
|
||||||
ARG node_version="18.15.0"
|
ARG node_version="18.15.0"
|
||||||
RUN touch ~/.bashrc && chmod +x ~/.bashrc
|
RUN mkdir /usr/local/nvm
|
||||||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v${nvm_version}/install.sh | bash
|
ENV NVM_DIR /usr/local/nvm
|
||||||
RUN source ~/.nvm/nvm.sh && nvm install ${node_version}
|
ADD https://raw.githubusercontent.com/nvm-sh/nvm/v${nvm_version}/install.sh /nvm_install.sh
|
||||||
|
RUN chmod +x /nvm_install.sh && /nvm_install.sh \
|
||||||
|
&& . $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
|
||||||
|
|
||||||
# add setup-cpp.js
|
# add setup-cpp.js
|
||||||
COPY "./dist/node18" "/"
|
COPY "./dist/node18" "/"
|
||||||
|
|
Loading…
Reference in New Issue