From 23a7caf8802d0df15325f2ff824a1529747981e2 Mon Sep 17 00:00:00 2001 From: mol Date: Sat, 24 Feb 2024 14:46:20 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d16ca3c..0ce21c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,14 +37,30 @@ RUN echo "安装基础工具与配置文件" && \ # 安装 node 环境 echo "安装 node 环境" && \ - apt-get install -y npm && \ + # apt-get install -y npm && \ + # 安装 brew 管理器 + export HOMEBREW_INSTALL_FROM_API=1 && \ + export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api" && \ + export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" && \ + export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git" && \ + export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git" && \ + git clone --depth=1 https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/install.git brew-install && \ + /bin/bash brew-install/install.sh && \ + rm -rf brew-install && \ + test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" && \ + test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && \ + test -r ~/.bash_profile && echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bash_profile && \ + test -r ~/.profile && echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.profile && \ + test -r ~/.zprofile && echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.zprofile && \ + brew update && \ + # 安装 n node 管理器 + brew install n && \ + n 18.15.0 && \ # 安装 nrm npm install -g nrm --registry=http://registry.npmmirror.com && \ nrm use taobao && \ - # 安装 n node 管理器 - npm install -g n && \ + # npm install -g n && \ # 安装最新版本 node - n 18.15.0 && \ # 安装 web 服务器 # npm i -g live-server