From 96594bb841a5d51db120477ee8b910c11c501b9f Mon Sep 17 00:00:00 2001 From: Scott J Dickerson Date: Fri, 15 Mar 2024 20:54:33 -0400 Subject: [PATCH] :ghost: force npm9 during image build Ever since the build container we use [1] updated to use `npm@10`, the image builder github action has encountered a number of problems. The first was solved with #1746. The second more random problem has been with network connections erroring out when installing dependencies. To work around the network error, force the build to use `npm@9`. Alternative solutions: - Add the force to `npm@9`` directly in the Dockerfile for use in all circumstances - Use the `:1-88` version of the build container instead of `:latest` - Find a way to use something like verdaccio to proxy/mirror the npmjs repo during the build so npmjs fetches can be pooled across the parallel image builds [1] registry.access.redhat.com/ubi9/nodejs-18:latest Signed-off-by: Scott J Dickerson --- .github/workflows/image-build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/image-build.yaml b/.github/workflows/image-build.yaml index 3e67b3fcf2..93226af123 100644 --- a/.github/workflows/image-build.yaml +++ b/.github/workflows/image-build.yaml @@ -22,6 +22,8 @@ jobs: containerfile: "./Dockerfile" architectures: '[ "amd64", "arm64", "ppc64le", "s390x" ]' extra-args: "--ulimit nofile=4096:4096" + pre_build_cmd: | + sed -i '/RUN npm clean-install/i RUN npm install -g npm@9' Dockerfile secrets: registry_username: ${{ secrets.QUAY_PUBLISH_ROBOT }} registry_password: ${{ secrets.QUAY_PUBLISH_TOKEN }}