AWS CodeBuild 错误,运行时版本不受支持 PHP 8.0

AWS CodeBuild Error, unsupported runtime version PHP 8.0

我正在使用 AWS CodeBuild,我在构建用于部署的 docker 图像时遇到了这个问题。但是,我遇到了 AWS 向我显示以下错误消息的问题 Unknown runtime version named '8.0' of php. This build image has the following versions: 7.3, 7.4 但是,在 documentation 中它说它支持 PHP V 8.0。 请注意,我正在使用 Laravel 9.0 以及 Laravel Sail、MySQL、Redis 和 MailHog 容器。

我附上我的 buildspec.yml 文件以供参考

version: 0.2

phases:
  install:
    runtime-versions: 
      php: 8.0
    commands:
      - echo "PHP Version ⬇"
      - php -v
      - echo "Initiation of build "
      - echo "Installing Composer "
      - curl -s https://getcomposer.org/installer | php
      - mv composer.phar /usr/local/bin/composer
      - echo "Installing dependencies "
      - composer install
      - echo "Installed dependencies "

  build:
    commands:
      - echo "Building "
      - composer build
      - echo "Built "

  post_build:
    commands:
      - echo "Post build "
      - echo "Build completed on `date` "

Php 8.0 是 only supported 如果您使用 Ubuntu standard:5.0 CodeBuild 图像。您收到错误的事实意味着您使用了与 Ubuntu standard:5.0.

不同的图像