use chromium to run karma on arm machines

flags=none

test plan:
 - On an ARM based machine (such as a MacBook with an m1)
   - Make sure js-tests.override.yml is in your COMPOSE_FILE
   - docker compose up js-tests

Change-Id: Id117329bb221e3f62d5071878253561b76315ed9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/302964
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
This commit is contained in:
Keith T. Garner 2022-10-10 15:41:24 -05:00 committed by Keith Garner
parent 5cc10aa0f9
commit 58ebd14f3f
1 changed files with 16 additions and 5 deletions

View File

@ -13,10 +13,21 @@ RUN if [ -n "$USER_ID" ]; then usermod -u "${USER_ID}" docker \
&& chown --from=9999 docker /usr/src/nginx /usr/src/app -R; fi
RUN apt-get update --quiet=2 \
&& curl -LOs https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& apt-get install --quiet=2 -y ./google-chrome-stable_current_amd64.deb git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ./google-chrome-stable_current_amd64.deb
&& if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
curl -LOs https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& apt-get install --quiet=2 -y ./google-chrome-stable_current_amd64.deb git \
&& rm -rf ./google-chrome-stable_current_amd64.deb ; \
elif [ "$(dpkg --print-architecture)" = "arm64" ]; then \
apt-get install --quiet=2 -y software-properties-common \
&& add-apt-repository ppa:phd/chromium-browser \
&& echo 'Package: *\nPin: release o=LP-PPA-phd-chromium-browser\nPin-Priority: 1001\n' | tee /etc/apt/preferences.d/phd-chromium-browser \
&& apt-get update --quiet=2 \
&& apt-get install --quiet=2 -y chromium-browser \
&& apt-get remove -y --autoremove software-properties-common \
&& ln -s /usr/bin/chromium-browser /usr/bin/google-chrome; \
fi \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
USER docker
@ -26,6 +37,6 @@ RUN set -eux; \
log \
node_modules \
tmp \
/home/docker/.cache/yarn \
/home/docker/.cache/yarn
EXPOSE 9876