使用 ebextensions 配置在弹性 beanstalk 上安装 firefox?

Install firefox on elastic beanstalk using ebextensions config?

我需要在我的弹性 beanstalk 部署中安装 firefox。我如何使用 ebextions 配置来安装 firefox?

我必须 运行 带有 Xvfb 的无头 firefox 才能从 URL.

生成屏幕截图

您可以使用 lambda-linux 创建的包。设置将如下所示:

.ebextensions/firefox.config:

files:
  "/opt/elasticbeanstalk/bin/setup_firefox.sh":
    mode: "000755"
    content: |
        #!/bin/bash
        curl -X GET -o RPM-GPG-KEY-lambda-epll https://lambda-linux.io/RPM-GPG-KEY-lambda-epll
        sudo rpm --import RPM-GPG-KEY-lambda-epll
        curl -X GET -o epll-release-2015.09-1.1.ll1.noarch.rpm https://lambda-linux.io/epll-release-2015.09-1.1.ll1.noarch.rpm
        sudo yum -y install epll-release-2015.09-1.1.ll1.noarch.rpm
        sudo yum --enablerepo=epll install firefox-compat

commands:
    set_firefox:
        test: test ! -f /opt/elasticbeanstalk/.post-provisioning-complete
        command: /opt/elasticbeanstalk/bin/setup_firefox.sh

.ebextensions/99_finalize_setup.配置:

commands:
  99_write_post_provisioning_complete_file:
    command: touch /opt/elasticbeanstalk/.post-provisioning-complete

这与上面的答案相同,但我从这里获得了更新的文件:https://lambda-linux.io/

files:
      "/opt/elasticbeanstalk/bin/setup_firefox.sh":
        mode: "000755"
        owner: root
        group: root
        content: |
            #!/bin/bash
            curl -X GET -o RPM-GPG-KEY-lambda-epll https://lambda-linux.io/RPM-GPG-KEY-lambda-epll
            sudo rpm --import RPM-GPG-KEY-lambda-epll
            curl -X GET -o epll-release-2017.03-1.2.ll1.noarch.rpm https://lambda-linux.io/epll-release-2017.03-1.2.ll1.noarch.rpm        
            sudo yum -y install epll-release-2017.03-1.2.ll1.noarch.rpm        
            sudo yum --enablerepo=epll install firefox-compat

commands:
    set_firefox:
        test: test ! -f /opt/elasticbeanstalk/.post-provisioning-complete
        command: /opt/elasticbeanstalk/bin/setup_firefox.sh