From 238a6369e8a11c6c7a8e8caade4ed517b8347621 Mon Sep 17 00:00:00 2001 From: Ben Banfield-Zanin Date: Sun, 16 Jan 2022 07:31:11 +0000 Subject: [PATCH] jibri: correct chromedriver mismatch * jibri: turn on -x so that we can see what is actually executing * jibri: bail out on the build if the actual release doesn't match the major release * jibri: ensure the correct chromedriver gets downloaded when CHROME_RELEASE != latest * jibri: move chrome installation to a separate script --- jibri/Dockerfile | 34 +++++++--------------------------- jibri/build/install-chrome.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 27 deletions(-) create mode 100755 jibri/build/install-chrome.sh diff --git a/jibri/Dockerfile b/jibri/Dockerfile index cc409ab..267d402 100644 --- a/jibri/Dockerfile +++ b/jibri/Dockerfile @@ -2,37 +2,17 @@ ARG JITSI_REPO=jitsi ARG BASE_TAG=latest FROM ${JITSI_REPO}/base-java:${BASE_TAG} +RUN apt-dpkg-wrap apt-get update && \ + apt-dpkg-wrap apt-get install -y jibri libgl1-mesa-dri procps jitsi-upload-integrations jq && \ + apt-cleanup + #ARG CHROME_RELEASE=latest #ARG CHROMEDRIVER_MAJOR_RELEASE=latest ARG CHROME_RELEASE=96.0.4664.45 ARG CHROMEDRIVER_MAJOR_RELEASE=96 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -RUN apt-dpkg-wrap apt-get update && \ - apt-dpkg-wrap apt-get install -y jibri libgl1-mesa-dri procps && \ - apt-cleanup && \ - [ "${CHROME_RELEASE}" = "latest" ] && \ - wget -qO - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmour /etc/apt/trusted.gpg.d/google.gpg && \ - echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list && \ - apt-dpkg-wrap apt-get update && \ - apt-dpkg-wrap apt-get install -y google-chrome-stable && \ - apt-cleanup || \ - [ "${CHROME_RELEASE}" != "latest" ] && \ - curl -4so "/tmp/google-chrome-stable_${CHROME_RELEASE}-1_amd64.deb" "http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_RELEASE}-1_amd64.deb" && \ - apt-dpkg-wrap apt-get update && \ - apt-dpkg-wrap apt-get install -y "/tmp/google-chrome-stable_${CHROME_RELEASE}-1_amd64.deb" && \ - apt-cleanup || \ - [ "${CHROMEDRIVER_MAJOR_RELEASE}" = "latest" ] && \ - CHROMEDRIVER_RELEASE="$(curl -4Ls https://chromedriver.storage.googleapis.com/LATEST_RELEASE)" || \ - CHROMEDRIVER_RELEASE="$(curl -4Ls https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROMEDRIVER_MAJOR_RELEASE})" && \ - curl -4Ls "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_RELEASE}/chromedriver_linux64.zip" \ - | zcat >> /usr/bin/chromedriver && \ - chmod +x /usr/bin/chromedriver && \ - chromedriver --version && \ - apt-dpkg-wrap apt-get update && \ - apt-dpkg-wrap apt-get install -y jitsi-upload-integrations jq && \ - apt-cleanup +COPY build/install-chrome.sh /install-chrome.sh +RUN /install-chrome.sh && \ + rm /install-chrome.sh COPY rootfs/ / diff --git a/jibri/build/install-chrome.sh b/jibri/build/install-chrome.sh new file mode 100755 index 0000000..195ac45 --- /dev/null +++ b/jibri/build/install-chrome.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -o pipefail -xeu + +if [ "${CHROME_RELEASE}" = "latest" ]; then + wget -qO - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmour > /etc/apt/trusted.gpg.d/google.gpg + echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list + apt-dpkg-wrap apt-get update + apt-dpkg-wrap apt-get install -y google-chrome-stable + apt-cleanup +else + curl -4so "/tmp/google-chrome-stable_${CHROME_RELEASE}-1_amd64.deb" "http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_RELEASE}-1_amd64.deb" + apt-dpkg-wrap apt-get update + apt-dpkg-wrap apt-get install -y "/tmp/google-chrome-stable_${CHROME_RELEASE}-1_amd64.deb" + apt-cleanup +fi + +if [ "${CHROMEDRIVER_MAJOR_RELEASE}" = "latest" ]; then + CHROMEDRIVER_RELEASE="$(curl -4Ls https://chromedriver.storage.googleapis.com/LATEST_RELEASE)" +else + CHROMEDRIVER_RELEASE="$(curl -4Ls https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROMEDRIVER_MAJOR_RELEASE})" +fi + +curl -4Ls "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_RELEASE}/chromedriver_linux64.zip" | zcat >> /usr/bin/chromedriver +chmod +x /usr/bin/chromedriver +chromedriver --version