From d883ec935ac9ec3ca17b2b19621b6ace8b177ef7 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Thu, 14 Jul 2022 12:11:25 +0200
Subject: [PATCH] CI: reduce the size of the CI docker container

Only install the required dependencies for chromium/firefox and nothing more.
We get the rest via playwright.
---
 .gitlab-ci/Dockerfile | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile
index cb20eed7..4fd07f42 100644
--- a/.gitlab-ci/Dockerfile
+++ b/.gitlab-ci/Dockerfile
@@ -20,10 +20,6 @@ RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.lis
 RUN apt-get update && apt-get install -y \
     nodejs \
     yarn \
-    chromium \
-    # libgbm1: newer chromium from puppeteer
-    libgbm1 \
-    firefox-esr \
     composer \
     php-zip \
     php-curl \
@@ -31,6 +27,15 @@ RUN apt-get update && apt-get install -y \
     sudo \
     && rm -rf /var/lib/apt/lists/*
 
+# only get dependencies of chromium/firefox
+RUN apt-get update && apt-get install --no-install-recommends -y \
+    chromium \
+    firefox-esr \
+    && apt-get remove -y \
+    chromium \
+    firefox-esr \
+    && rm -rf /var/lib/apt/lists/*
+
 RUN useradd -u 1000 -ms /bin/bash user
 RUN echo 'user ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
 USER user
-- 
GitLab