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

时间:2015-12-09 10:09:22

标签: firefox elastic-beanstalk xvfb amazon-elastic-beanstalk

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

我必须使用Xvfb运行无头firefox,以便从URL生成屏幕截图。

2 个答案:

答案 0 :(得分:3)

您可以使用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.config:

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

答案 1 :(得分:1)

这与上面的答案相同,但是我从这里获得了更新的文件: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