代码之家  ›  专栏  ›  技术社区  ›  Josh Withee

AWS CodeBuild Docker映像与ASP.NET Core 2.2

  •  0
  • Josh Withee  · 技术社区  · 6 年前

    mcr.microsoft.com/dotnet/core/sdk:2.2 .

    它被卡住了 pip install --upgrade awscli ... 我想是因为 pip 皮普 我得到一个错误:

    Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: apt-get install python3-dev. Reason: exit status 1

    我的故障排除尝试包括:

    • 切换 Privileged 代码生成环境的标志
    • 包括和不包括 sudo buildspec.yml 命令
    • 两个都试 pip3

    建筑规格yml :

    version: 0.2
    phases:
      pre_build:
        commands:
          - apt-get update --fix-missing
          - apt-get install -y apt-transport-https
          - apt-get update
          - apt-get install python3-dev
          - apt-get install python3-pip
          - pip3 install --upgrade awscli
          - dotnet restore AspNetCoreWebApplication/AspNetCoreWebApplication.csproj
          - dotnet restore AspNetCoreWebApplicationTest/AspNetCoreWebApplicationTest.csproj
      build:
        commands:
          .....the rest omitted for brevity......
    

    我的问题是为什么这不起作用?

    0 回复  |  直到 6 年前
        1
  •  1
  •   Josh Withee    6 年前

    发现了问题。这些命令:

    apt-get install python3-dev
    apt-get install python3-pip
    

    需要包括 -y 自动对任何提示说是的标志 从命令中。

    添加这样的标志可以:

    apt-get install -y python3-dev
    apt-get install -y python3-pip