Skip to content

Commit acf7691

Browse files
authored
Fix Base image build (#5254)
Title: Fix Cloud Build GPG errors and upgrade to Node.js 20 (LTS) Summary This PR resolves the build failures in the clusterfuzz-images project caused by missing or expired GPG keys in the legacy NodeSource installation scripts. It also upgrades the base environment to use Node.js 20 (LTS). Problem The existing docker/base build was failing with the following error: GPG error: https://deb.nodesource.com/node_19.x focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1655A0AB68576280 This was due to the use of the deprecated setup_19.x script and a Node.js version (19) that is no longer supported. Solution 1. Upgraded to Node.js 20 (LTS): Migrated from Node 19 to the current stable Long Term Support version. 2. Modernized Installation Method: Replaced the legacy 15,000-line setup_19.x bash script with the modern, secure NodeSource installation method using /etc/apt/keyrings and a signed repository entry. 3. Binary Version Consistency: Updated the Ubuntu 24.04 Dockerfile to download and install the Node 20.12.2 (LTS) binary directly. 4. Cleanup: Removed the now-obsolete docker/base/setup_19.x script from the repository. Changes - docker/base/Dockerfile: Updated to use the new NodeSource apt repository method for Node 20. - docker/base/ubuntu-20-04.Dockerfile: Updated to use the new NodeSource apt repository method for Node 20. - docker/base/ubuntu-24-04.Dockerfile: Updated binary download URL and extraction logic for Node 20.12.2. - docker/base/setup_19.x: Deleted. Impact - Fixes all base image builds in Cloud Build. - Ensures the project uses a supported, secure version of Node.js. - Reduces technical debt by removing legacy scripts in favor of standard Linux package management.
1 parent ffda83d commit acf7691

4 files changed

Lines changed: 15 additions & 377 deletions

File tree

docker/base/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ RUN apt-get update && \
6767
util-linux \
6868
wget \
6969
zip \
70-
zlib1g-dev
70+
zlib1g-dev \
71+
gnupg
7172

7273
COPY --from=xenial \
7374
/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 \
@@ -127,8 +128,10 @@ RUN pip3.11 --no-cache-dir install pipenv==2022.8.5
127128
RUN ln -s /usr/local/bin/python3.11 /usr/bin/python3.11
128129

129130
# Install Node.js
130-
COPY setup_19.x /data
131-
RUN bash setup_19.x && apt-get update -y && apt-get install -y nodejs
131+
RUN mkdir -p /etc/apt/keyrings && \
132+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
133+
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
134+
apt-get update && apt-get install nodejs -y
132135

133136
# Support i386.
134137
RUN dpkg --add-architecture i386

docker/base/setup_19.x

Lines changed: 0 additions & 368 deletions
This file was deleted.

0 commit comments

Comments
 (0)