Building the Docker Image fails

Building the dockerfile fails after the commands:

Using npm script:

npm run dockerbuild

OR using direct Docker command:

docker build . --target bolt-ai-development

docker build . --target bolt-ai-development

Sending build context to Docker daemon 2.768MB
Step 1/41 : ARG BASE=node:20.18.0
Step 2/41 : FROM ${BASE} AS base
—> 2fdabcc143dd
Step 3/41 : WORKDIR /app
—> Using cache
—> fb36670621ae
Step 4/41 : COPY package.json pnpm-lock.yaml ./
—> Using cache
—> 960e89ef54fa
Step 5/41 : RUN corepack enable pnpm && pnpm install
—> Running in 7760d89b1781
/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21535
if (key == null || signature == null) throw new Error(Cannot find matching keyid: ${JSON.stringify({ signatures, keys })});
^

Error: Cannot find matching keyid: {“signatures”:[{“sig”:“MEYCIQDbcyRXEEpUvMj22WsicmOsvx+ctqHZv1vLScf3/247EAIhANfMkRDNAHdtTDNZ34BVH2z2z0Ef8o5VK4osH6ES9RHW”,“keyid”:“SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U”}],“keys”:[{“expires”:null,“keyid”:“SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA”,“keytype”:“ecdsa-sha2-nistp256”,“scheme”:“ecdsa-sha2-nistp256”,“key”:“MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg==”}]}
at verifySignature (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21535:47)
at fetchLatestStableVersion (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21553:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async fetchLatestStableVersion2 (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21672:14)
at async Engine.getDefaultVersion (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22292:23)
at async Engine.executePackageManagerRequest (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22390:47)
at async Object.runMain (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23096:5)

Node.js v20.18.0
The command ‘/bin/sh -c corepack enable pnpm && pnpm install’ returned a non-zero code: 1

I ran into this. The bolt.diy github issues page had a workaround:

Specifically the reply by Carcalto worked for me.

try to edit the Dockerfile found inside the Bolt folder —

“RUN corepack enable pnpm && pnpm install”
— by —
“RUN npm install -g pnpm && pnpm install”

— this in theory causes PNPM to be installed without depending on Corepack. If that doesn’t work, just go back to the original