Can't build custom image

Describe the problem/error/question

First time using n8n (superiors instructed to figure out if we should use it) and got an error while tried to build custom image. In case I changed something that I shouldn’t have, I cloned another copy and then went straight to the building, but still got same problem. Am I doing something wrong ? (probably yes, but what exactly)

What is the error message (if any)?


(base) [email protected]:~/test/n8n$ docker build -t n8n-custom -f docker/images/n8n-custom/Dockerfile .
[+] Building 298.0s (13/25)
=> [internal] load build definition from Dockerfile 0.3s
=> => transferring dockerfile: 1.85kB 0.0s
=> [internal] load .dockerignore 0.5s
=> => transferring context: 191B 0.0s
=> [internal] load metadata for docker.io/n8nio/base:16 0.0s
=> CACHED [builder 1/17] FROM docker.io/n8nio/base:16 0.0s
=> [internal] load build context 2.7s
=> => transferring context: 25.47MB 2.3s
=> [builder 2/17] COPY --chown=node:node turbo.json package.json .npmrc pnpm-lock.yaml pnpm-workspace.yaml jest.config.js tsconfig.json ./ 9.7s
=> [builder 3/17] COPY --chown=node:node scripts ./scripts 1.0s
=> [builder 4/17] COPY --chown=node:node packages ./packages 3.5s
=> [builder 5/17] COPY --chown=node:node patches ./patches 0.9s
=> [builder 6/17] RUN apk add --update libc6-compat jq 4.1s
=> [builder 7/17] RUN corepack enable && corepack prepare --activate 3.4s
=> [builder 8/17] RUN pnpm install --frozen-lockfile 95.8s
=> ERROR [builder 9/17] RUN pnpm build 174.6s

[builder 9/17] RUN pnpm build:
#0 1.951
#0 1.951 > [email protected] build /home/node
#0 1.951 > turbo run build
#0 1.951
#0 2.511 • Packages in scope: @n8n_io/eslint-config, n8n, n8n-core, n8n-design-system, n8n-editor-ui, n8n-nodes-base, n8n-workflow
#0 2.511 • Running build in 7 packages
#0 2.512 • Remote caching disabled
#0 2.516 n8n-design-system:build: cache miss, executing 8d05dbf273e420d2
#0 2.517 n8n-workflow:build: cache miss, executing abf92b838af6a1f6
#0 3.187 n8n-workflow:build:
#0 3.187 n8n-workflow:build: > [email protected] build /home/node/packages/workflow
#0 3.187 n8n-workflow:build: > tsc -p tsconfig.build.json
#0 3.187 n8n-workflow:build:
#0 3.206 n8n-design-system:build:
#0 3.206 n8n-design-system:build: > [email protected] build /home/node/packages/design-system
#0 3.206 n8n-design-system:build: > vite build
#0 3.206 n8n-design-system:build:
#0 4.572 n8n-design-system:build: vite v4.0.4 building for production…
#0 5.333 n8n-design-system:build: transforming…
#0 13.78 n8n-core:build: cache miss, executing 0aa3d624fecd8e8d
#0 14.51 n8n-core:build:
#0 14.51 n8n-core:build: > [email protected] build /home/node/packages/core
#0 14.51 n8n-core:build: > tsc -p tsconfig.build.json
#0 14.51 n8n-core:build:
#0 23.17 n8n-nodes-base:build: cache miss, executing e1140b3fc4a7a6df
#0 23.90 n8n-design-system:build: ✓ 863 modules transformed.
#0 23.92 n8n-nodes-base:build:
#0 23.92 n8n-nodes-base:build: > [email protected] build /home/node/packages/nodes-base
#0 23.92 n8n-nodes-base:build: > tsc -p tsconfig.build.json && gulp build:icons && gulp build:translations && pnpm build:metadata
#0 23.92 n8n-nodes-base:build:
#0 25.32 n8n-design-system:build: rendering chunks…
#0 25.46 n8n-design-system:build: computing gzip size…
#0 25.84 n8n-design-system:build: dist/style.css 54.72 kB │ gzip: 8.66 kB
#0 25.84 n8n-design-system:build: dist/n8n-design-system.es.js 2,088.26 kB │ gzip: 470.73 kB
#0 28.00 n8n-design-system:build: dist/n8n-design-system.umd.js 1,270.79 kB │ gzip: 380.69 kB
#0 28.21 n8n-editor-ui:build: cache miss, executing 1931b922ff4eb276
#0 28.98 n8n-editor-ui:build:
#0 28.98 n8n-editor-ui:build: > [email protected] build /home/node/packages/editor-ui
#0 28.98 n8n-editor-ui:build: > cross-env VUE_APP_PUBLIC_PATH=“/{{BASE_PATH}}/” NODE_OPTIONS=“–max-old-space-size=8192” vite build
#0 28.98 n8n-editor-ui:build:
#0 32.96 n8n-editor-ui:build: vite v4.0.4 building for production…
#0 33.13 n8n-editor-ui:build: transforming…
#0 91.45 n8n-editor-ui:build: ✓ 2990 modules transformed.
#0 120.8 n8n-nodes-base:build: [19:39:21] Using gulpfile ~/packages/nodes-base/gulpfile.js
#0 120.8 n8n-nodes-base:build: [19:39:21] Starting ‘build:icons’…
#0 121.3 n8n-nodes-base:build: [19:39:23] Finished ‘build:icons’ after 1.23 s
#0 123.7 n8n-nodes-base:build: [19:39:25] Using gulpfile ~/packages/nodes-base/gulpfile.js
#0 123.7 n8n-nodes-base:build: [19:39:25] Starting ‘build:translations’…
#0 123.7 n8n-nodes-base:build: Default locale set to: en
#0 123.7 n8n-nodes-base:build: No translation required - Skipping translations build…
#0 123.7 n8n-nodes-base:build: [19:39:25] Finished ‘build:translations’ after 5.14 ms
#0 127.4 n8n-nodes-base:build:
#0 127.4 n8n-nodes-base:build: > n8n-[email protected] build:metadata /home/node/packages/nodes-base
#0 127.4 n8n-nodes-base:build: > pnpm n8n-generate-known && pnpm n8n-generate-ui-types
#0 127.4 n8n-nodes-base:build:
#0 168.3 n8n-editor-ui:build: ELIFECYCLE Command failed with exit code 1.
#0 168.6 n8n-editor-ui:build: ERROR: command finished with error: command (/home/node/packages/editor-ui) pnpm run build exited (1)
#0 168.6 n8n-nodes-base:build: ELIFECYCLE Command failed.
#0 168.7 n8n-nodes-base:build: ELIFECYCLE Command failed.
#0 168.7 command (/home/node/packages/editor-ui) pnpm run build exited (1)
#0 168.7
#0 168.7 Tasks: 3 successful, 5 total
#0 168.7 Cached: 0 cached, 5 total
#0 168.7 Time: 2m46.701s
#0 168.7
#0 168.8 ERROR run failed: command exited (1)
#0 168.9 ELIFECYCLE Command failed with exit code 1.
Dockerfile:16

14 |
15 | RUN pnpm install --frozen-lockfile
16 | >>> RUN pnpm build
17 | RUN rm -rf node_modules
18 | RUN jq ‘del(.pnpm.patchedDependencies)’ package.json > package.json.tmp; mv package.json.tmp package.json

ERROR: failed to solve: process “/bin/sh -c pnpm build” did not complete successfully: exit code: 1

Information on your n8n setup

  • n8n version: 0.227.0
  • Running n8n via Docker
  • Ubuntu 20.04.6 LTS

Welcome to the community @Gnevich!

Sorry to hear that you have problems. Sadly no idea right now what is going on. I m using “Ubuntu 22.04.2 LTS” and did the same as you: Checked out n8n newly from GitHub and then did run:
docker build -t n8n-custom -f docker/images/n8n-custom/Dockerfile .
For me, it did however run through without a problem:

[+] Building 189.0s (27/27) FINISHED                                            
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 191B                                          0.0s
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 1.85kB                                     0.0s
 => [internal] load metadata for docker.io/n8nio/base:16                   1.8s
 => [auth] n8nio/base:pull token for registry-1.docker.io                  0.0s
 => [internal] load build context                                          0.3s
 => => transferring context: 25.47MB                                       0.3s
 => [builder  1/17] FROM docker.io/n8nio/base:[email protected]:66deb688242abf0c3  0.1s
 => => resolve docker.io/n8nio/base:[email protected]:66deb688242abf0c3de148bede5  0.0s
 => => sha256:66deb688242abf0c3de148bede51fea89e42cce15e73f93 990B / 990B  0.0s
 => => sha256:324d842d554aee482f9f4e7c968884fb12ba75e106e 1.68kB / 1.68kB  0.0s
 => => sha256:33e07921435be61ac94f8d04c617037330d96c130e4 7.29kB / 7.29kB  0.0s
 => [builder  2/17] COPY --chown=node:node turbo.json package.json .npmrc  0.1s
 => [builder  3/17] COPY --chown=node:node scripts ./scripts               0.0s
 => [builder  4/17] COPY --chown=node:node packages ./packages             0.3s
 => [builder  5/17] COPY --chown=node:node patches ./patches               0.0s
 => [builder  6/17] RUN apk add --update libc6-compat jq                   1.1s
 => [builder  7/17] RUN corepack enable && corepack prepare --activate     4.8s
 => [builder  8/17] RUN pnpm install --frozen-lockfile                    39.9s 
 => [builder  9/17] RUN pnpm build                                        71.7s 
 => [builder 10/17] RUN rm -rf node_modules                                5.4s 
 => [builder 11/17] RUN jq 'del(.pnpm.patchedDependencies)' package.json   0.4s
 => [builder 12/17] RUN jq '{name: .name, version: .version}' packages/ed  0.3s
 => [builder 13/17] RUN jq '{name: .name, version: .version}' packages/de  0.4s
 => [builder 14/17] RUN NODE_ENV=production pnpm install --prod --no-opt  45.4s
 => [builder 15/17] RUN find . -type f -name "*.ts" -o -name "*.js.map" -  2.4s
 => [builder 16/17] RUN rm -rf packages/@n8n_io/eslint-config packages/ed  0.5s
 => [builder 17/17] RUN rm -rf patches .npmrc *.yaml node_modules/.cache   2.2s
 => [stage-1 2/5] COPY --from=builder /home/node /usr/local/lib/node_modu  3.8s
 => [stage-1 3/5] RUN ln -s /usr/local/lib/node_modules/n8n/packages/cli/  0.2s
 => [stage-1 4/5] COPY docker/images/n8n-custom/docker-entrypoint.sh /     0.0s
 => [stage-1 5/5] RUN  mkdir .n8n &&  chown node:node .n8n                 0.3s
 => exporting to image                                                     3.5s
 => => exporting layers                                                    3.5s
 => => writing image sha256:f79659c18d0be6a67bb4e8196b64e7687a4903a2f9315  0.0s
 => => naming to docker.io/library/n8n-custom                              0.0s

Maybe @netroy has an idea on Monday.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.