Building n8n custom docker fails

Describe the problem/error/question

When I get Latest stable release It’s failing to run in docker.

What is the error message (if any)?

! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-9.15.1.tgz
Scope: all 22 workspace projects
packages/@n8n_io/eslint-config | WARN deprecated [email protected]
packages/cli | WARN deprecated [email protected]
WARN 20 deprecated subdependencies found: @aws-sdk/[email protected], @aws-sdk/[email protected], @aws-sdk/[email protected], @azure/[email protected], @humanwhocodes/[email protected], @humanwhocodes/[email protected], @npmcli/[email protected], @xmldom/[email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
…/[email protected]/node_modules/sqlite3 install$ prebuild-install -r napi || node-gyp rebuild
…/[email protected]/node_modules/sqlite3 install: prebuild-install warn install Request timed out
…/[email protected]/node_modules/sqlite3 install: gyp WARN install got an error, rolling back install
…/[email protected]/node_modules/sqlite3 install: gyp ERR! configure error
…/[email protected]/node_modules/sqlite3 install: gyp ERR! stack FetchError: request to https://unofficial-builds.nodejs.org/download/release/v20.18.0/node-v20.18.0-headers.tar.gz failed, reason: getaddrinfo EAI_AGAIN unofficial-builds.nodejs.org
…/[email protected]/node_modules/sqlite3 install: gyp ERR! stack at ClientRequest. (/src/node_modules/.pnpm/[email protected]/node_modules/minipass-fetch/lib/index.js:110:14)
…/[email protected]/node_modules/sqlite3 install: gyp ERR! stack at ClientRequest.emit (node:events:519:28)
…/[email protected]/node_modules/sqlite3 install: gyp ERR! stack at emitErrorEvent (node:_http_client:101:11)
…/[email protected]/node_modules/sqlite3 install: gyp ERR! stack at TLSSocket.socketErrorListener (node:_http_client:504:5)
…/[email protected]/node_modules/sqlite3 install: gyp ERR! stack at TLSSocket.emit (node:events:531:35)
…/[email protected]/node_modules/sqlite3 install: gyp ERR! stack at emitErrorNT (node:internal/streams/destroy:169:8)
…/[email protected]/node_modules/sqlite3 install: gyp ERR! stack at emitErrorCloseNT (node:internal/streams/destroy:128:3)
…/[email protected]/node_modules/sqlite3 install: gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
…/[email protected]/node_modules/sqlite3 install: gyp ERR! System Linux 5.15.146.1-microsoft-standard-WSL2
…/[email protected]/node_modules/sqlite3 install: gyp ERR! command “/usr/local/bin/node” “/src/node_modules/.pnpm/[email protected]/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
…/[email protected]/node_modules/sqlite3 install: gyp ERR! cwd /src/node_modules/.pnpm/[email protected]/node_modules/sqlite3
…/[email protected]/node_modules/sqlite3 install: gyp ERR! node -v v20.18.0
…/[email protected]/node_modules/sqlite3 install: gyp ERR! node-gyp -v v8.4.1
…/[email protected]/node_modules/sqlite3 install: gyp ERR! not ok
…/[email protected]/node_modules/sqlite3 install: Failed
ELIFECYCLE Command failed with exit code 1.
The command ‘/bin/sh -c DOCKER_BUILD=true pnpm install --no-frozen-lockfile’ returned a non-zero code: 1

Information on your n8n setup

  • n8n version: 1.76.2
  • Database (default: SQLite): postgresql
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: windows

This sounds like something on your network was blocking requests to unofficial-builds.nodejs.org
are you able to open this domain in your browser without any issues ?strong text

Hi @netroy ,

I can see this on browser.

Thank you,
Tanay Patil

maybe it was an intermittent DNS issue. Can you please try building the docker image again?

Hi @netroy ,

I am still getting same error.

that sounds like the DNS docker containers are configured to use are failing to resolve this domain in a timely manner. maybe use an external CI (like github) build your custom images?
If you have a n8n fork on github, you can simply use the existing workflow Docker Custom Image CI · Workflow runs · n8n-io/n8n · GitHub