-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Docker build fails due to Corepack PNPM signature verification error #11037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Currently there is some problem with corepack. Updating it fixes this problem:
use this code before |
I was able to resolve this in my Dockerfile by adding this to my deps AND builder. # Update and enable Corepack
RUN npm install -g corepack@latest && \
corepack enable Vercel recently made a guide. https://vercel.com/guides/corepack-errors-github-actions |
The error Cannot find matching keyid: ${JSON.stringify({ signatures, keys })} in a Docker build, specifically within the context of PNPM and Corepack, indicates an issue with verifying the signatures of packages being installed. This usually arises due to a mismatch between the expected and actual keys used to sign the packages in the npm registry. So I Updated my Node version from 20 to 22 and it worked! - FROM node:20-alpine AS base
+ FROM node:22-alpine AS base |
I fixed it by updating the node image from:
|
This error was due to a key rotation issue with corepack, large thread here: nodejs/corepack#612 There area few workarounds in that thread. Here is one solution specifically that should work for you. Closing this as it is not directly related to Payload. |
Describe the Bug
Description
The current Dockerfile fails to build due to a Corepack signature verification error when trying to install PNPM. This is related to a known issue with recent versions of PNPM and Corepack (see: pnpm/pnpm#9029).
I attached my workaround for pnpm to the bottom of this write up
Error Message
Steps to Reproduce
docker buildx build --platform linux/amd64 .
Working Solution
I've implemented a workaround by updating the Dockerfile to use a specific version of Corepack and PNPM. Here are the changes needed:
Add this code block in the
deps
andbuilder
stages:WORKAROUND DOCKER FILE:
Link to the code that reproduces this issue
https://github.com/payloadcms/payload/tree/main/templates/website
Reproduction Steps
Set up the payload website template with
pnpm
and then rundocker buildx build --platform linux/amd64 .
Which area(s) are affected? (Select all that apply)
area: core
Environment Info
The text was updated successfully, but these errors were encountered: