在 Amazon Linux 2 上为 Docker 配置静态文件设置以错误结束

Configuring static files settings for Docker on Amazon Linux 2 ends with the error

当为 aws:elasticbeanstalk:environment:proxy:staticfiles 做任何类型的尝试时,它就是行不通。每次我收到有关无效选项规范的错误时。所有其余的 ebextensions 设置都非常有效。

我尝试的示例片段:

option_settings:
  aws:elasticbeanstalk:environment:proxy:staticfiles:
    /stylesheets: public/stylesheets
    /fonts: public/fonts
    /html: public/html

eb deploy 错误:

2021-04-09 08:12:02    ERROR   "option_settings" in one of the configuration files failed validation. More details to follow.
2021-04-09 08:12:02    ERROR   Invalid option specification (Namespace: 'aws:elasticbeanstalk:environment:proxy:staticfiles', OptionName: '/stylesheets'): Unknown configuration setting.
...

运行 EB 平台 Docker 在 64 位亚马逊上 Linux 2,版本 3.2.6。我开始怀疑这个 staticfiles 规范出于任何原因在这个平台上不受支持,但我在 AWS EB 文档中爬行以寻找任何提示但没有成功。有趣的是,Web 控制台中也没有静态文件部分 UI。

我尝试了每一种配置风格 - 尾部斜杠、引号、这些路径的不同集合……都没有用。

staticfiles 不支持 Docker 平台。来自 docs:

Elastic Beanstalk supports configuring the proxy to serve static files on most platform branches based on Amazon Linux 2. The one exception is Docker.