Divio Cloud deployment error: ENOGIT git is not installed or not in the PATH

Divio Cloud deployment error: ENOGIT git is not installed or not in the PATH

我将 Divio Control Dashboard 上的所有附加组件和 Python 版本更新为推荐版本,之后我无法部署我的项目。错误信息是:

 ---> Running in fb3fc5000391
[91mbower bootstrap-sass-official#3.3.5           ENOGIT git is not installed or not in the PATH

Stack trace:
Error: git is not installed or not in the PATH
    at createError (/opt/nvm/versions/node/v6.10.1/lib/node_modules/bower/lib/util/createError.js:4:15)
    at GitHubResolver.GitResolver (/opt/nvm/versions/node/v6.10.1/lib/node_modules/bower/lib/core/resolvers/GitResolver.js:45:15)
    at GitHubResolver.GitRemoteResolver (/opt/nvm/versions/node/v6.10.1/lib/node_modules/bower/lib/core/resolvers/GitRemoteResolver.js:10:17)
    at new GitHubResolver (/opt/nvm/versions/node/v6.10.1/lib/node_modules/bower/lib/core/resolvers/GitHubResolver.js:13:23)
    at /opt/nvm/versions/node/v6.10.1/lib/node_modules/bower/lib/core/resolverFactory.js:20:16```

您遇到的问题是,当构建 Docker 映像并执行 Dockerfile 中的命令时,需要 Git,但找不到它.

您需要安装什么

您需要安装 Git,您可以在 Dockerfile 中安装:

RUN apt-get update && \
    apt-get install -y git

在哪里 运行 命令

您需要 运行 它 需要 Git.

的命令之前

其实Git是一个比较低级的命令,在安装过程中经常用到,所以要尽早安装,比如在FROM之后尽快安装指定基本图像的命令。

请参阅 Divio 文档中的 How to install system packages in a project

为什么你现在需要这样做

您提到您更新了项目的 Python 版本。在 Divio Cloud 项目中,这可以通过控制面板完成。最新版本的 Divio Python 基础项目包括 slimmed-down 基础映像,其中不包括以前安装的所有系统包(Git 也在其中)。

另请参阅 The Dockerfile,其中详细介绍了 Dockerfile 在 Divio Projects 中的使用方式。