aws/aws-codebuild-docker-images

Is there a recommended way for installing Chrome and Firefox on CodeBuild?

trivikr opened this issue · 1 comments

The ubuntu/standard/5.0 used to install Chrome and Firefox by default.
Dockerfile:

# Install Firefox
RUN set -ex \
&& apt-add-repository -y "deb http://archive.canonical.com/ubuntu $(lsb_release -sc) partner" \
&& apt-get install -y -qq firefox \
&& firefox --version
# Install GeckoDriver
RUN set -ex \
&& apt-get install -y -qq firefox-geckodriver \
&& geckodriver --version
# Install Chrome
RUN set -ex \
&& wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google.list \
&& apt-get update \
&& apt-get install -y -qq google-chrome-stable \
&& google-chrome --version

Chrome and Firefox are no longer installed in ubuntu/standard/6.0 and later.
Dockerfile: https://github.com/aws/aws-codebuild-docker-images/blob/master/ubuntu/standard/6.0/Dockerfile

These binaries were useful in running browser tests in the past, and folks who upgrade their CodeBuild versions without explicitly installing Chrome/Firefox binaries will get following errors:

08 06 2023 04:20:42.659:ERROR [launcher]: No binary for ChromeHeadless browser on your platform.
  Please, set "CHROME_BIN" env variable.
08 06 2023 04:20:42.675:ERROR [launcher]: Cannot start Firefox
    Can not find the binary firefox
    Please set env variable FIREFOX_BIN

is there a recommended way for installing Chrome and Firefox on Codebuild?

Duplicate of: #562