From 0c3355a8c919e6367ab7ac876a07345e4acc1ac3 Mon Sep 17 00:00:00 2001 From: Nikolai R Kristiansen Date: Sat, 25 Oct 2025 14:07:53 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20yarn=20install=20using=20c?= =?UTF-8?q?orepack=20on=20node=20v25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also fail faster on builds by setting `-euo pipefail` --- Dockerfile | 4 ++-- templates/alpine.Dockerfile | 4 +++- templates/debian.Dockerfile | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3f99761..10937f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ FROM python:trixie LABEL org.opencontainers.image.authors="Nikolai R Kristiansen " +SHELL ["/bin/bash", "-euo", "pipefail", "-c"] RUN groupadd --gid 1000 pn && useradd --uid 1000 --gid pn --shell /bin/bash --create-home pn ENV POETRY_HOME=/usr/local -# Install nodejs and yarn RUN NODE_VERSION="$(curl -fsSL https://nodejs.org/dist/latest/SHASUMS256.txt | head -n1 | awk '{ print $2}' | awk -F - '{ print $2}')" \ ARCH= && dpkgArch="$(dpkg --print-architecture)" \ && case "${dpkgArch##*-}" in \ @@ -23,7 +23,7 @@ RUN NODE_VERSION="$(curl -fsSL https://nodejs.org/dist/latest/SHASUMS256.txt | h && tar -xJf "node-$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ && rm "node-$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \ && ln -s /usr/local/bin/node /usr/local/bin/nodejs -RUN corepack enable yarn +RUN npm install -g corepack && corepack enable yarn RUN \ apt-get update && \ apt-get upgrade -yqq && \ diff --git a/templates/alpine.Dockerfile b/templates/alpine.Dockerfile index fbf42f0..4375eb3 100644 --- a/templates/alpine.Dockerfile +++ b/templates/alpine.Dockerfile @@ -3,6 +3,8 @@ # nodejs: {{ nodejs_canonical }} FROM python:{{ python_image }} AS builder +SHELL ["/bin/ash", "-eo", "pipefail", "-c"] + # Install node prereqs, nodejs and yarn # Ref: https://raw.githubusercontent.com/nodejs/docker-node/master/Dockerfile-alpine.template # Ref: https://yarnpkg.com/en/docs/install @@ -21,7 +23,7 @@ LABEL org.opencontainers.image.authors="Nikolai R Kristiansen