【Dockerfile】nvm-git-node-centos7镜像

# 依赖centos环境
FROM centos:7

#安装vim、git和nvm环境
RUN yum install -y wget \
    && mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak \
    && wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo \
    && yum -y update \
    && yum -y install vim \
    && yum -y install git \
    && git --version \
    && cd ~/ \
    && git clone https://gitee.com/Annlix/nvm-sh_nvm.git .nvm \
    && cd ~/.nvm && git checkout v0.39.1 \
    && echo "source ~/.nvm/nvm.sh" >> ~/.bashrc && source ~/.bashrc
    # 增加国内node和npm源,不然install会卡
RUN source ~/.bashrc \
    && export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node/ \
    && export NVM_IOJS_ORG_MIRROR=http://npm.taobao.org/mirrors/iojs \
    && nvm install 14.20.0 \
    && nvm use 14.20.0

 

posted @ 2023-03-03 15:01  zipon  阅读(97)  评论(0编辑  收藏  举报