From ff7fa67682f43aaaf7d52e4a26f9aabe19fb3158 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sun, 25 Jan 2026 21:25:08 +0100 Subject: [PATCH] Install Yarn via npm instead of Debian packages in Dockerfiles (#1207) * Initial plan * Change yarn installation from Debian packages to npm in both Dockerfiles Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com> --- Dockerfile | 8 +++----- Dockerfile-frankenphp | 24 +++++++----------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index cb18c78f..8ebd320c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,13 +46,11 @@ RUN apt-get update && apt-get -y install \ && rm -rvf /var/www/html/* # Install node and yarn -RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ - curl -sL https://deb.nodesource.com/setup_22.x | bash - && \ +RUN curl -sL https://deb.nodesource.com/setup_22.x | bash - && \ apt-get update && apt-get install -y \ nodejs \ - yarn \ - && apt-get -y autoremove && apt-get clean autoclean && rm -rf /var/lib/apt/lists/* + && apt-get -y autoremove && apt-get clean autoclean && rm -rf /var/lib/apt/lists/* && \ + npm install -g yarn # Install composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer diff --git a/Dockerfile-frankenphp b/Dockerfile-frankenphp index f381f330..69b9bacd 100644 --- a/Dockerfile-frankenphp +++ b/Dockerfile-frankenphp @@ -14,31 +14,21 @@ RUN apt-get update && apt-get -y install \ && apt-get -y autoremove && apt-get clean autoclean && rm -rf /var/lib/apt/lists/*; RUN set -eux; \ - # Prepare keyrings directory - mkdir -p /etc/apt/keyrings; \ - \ - # Import Yarn GPG key - curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg \ - | tee /etc/apt/keyrings/yarn.gpg >/dev/null; \ - chmod 644 /etc/apt/keyrings/yarn.gpg; \ - \ - # Add Yarn repo with signed-by - echo "deb [signed-by=/etc/apt/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian stable main" \ - | tee /etc/apt/sources.list.d/yarn.list; \ - \ - # Run NodeSource setup script (unchanged) + # Run NodeSource setup script curl -sL https://deb.nodesource.com/setup_22.x | bash -; \ \ - # Install Node.js + Yarn + # Install Node.js apt-get update; \ apt-get install -y --no-install-recommends \ - nodejs \ - yarn; \ + nodejs; \ \ # Cleanup apt-get -y autoremove; \ apt-get clean autoclean; \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/*; \ + \ + # Install Yarn via npm + npm install -g yarn # Install PHP