4

I need to install firefox on my elastic beanstalk deployment. How can I use the ebextions config to install firefox?

I have to run headless firefox with Xvfb for generating screenshots from a URL.

Vineet
  • 1,139
  • 1
  • 11
  • 20

2 Answers2

3

You can use the package created by lambda-linux. The setup will look like this:

.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
Tal
  • 7,827
  • 6
  • 38
  • 61
  • I tried these commands manually through SSH, but when trying to install **epll-release-2015.09-1.1.ll1.noarch.rpm**, it says that it needs amazon linux version 2015.09 whereas the amazon linux deployed on beanstalk is version 2015.03 – Vineet Dec 09 '15 at 10:36
  • any reason not to upgrade to the latest? – Tal Dec 09 '15 at 10:52
  • Upgrading... I'll test it out and see if it works. Thanks :) – Vineet Dec 09 '15 at 11:10
  • 1
    Does this install Firefox or just enables firefox compatibility? – Pranab Nov 07 '16 at 14:54
  • Is Firefox installed after running this? If so, where can I find the binary path? – Tom Jun 11 '17 at 22:44
1

This is the same answer as above but with updated files I got from here: 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
Tom
  • 136
  • 9