Custom docker image env: can't execute 'node ': No such file or directory

Describe the problem/error/question

I am building the custom-docker Dockerfile with the latest code from the GitHub master branch. When I run it both via docker-compose and as a single image using docker run, I get the error I shared.

docker file : n8n/docker/images/n8n-custom/Dockerfile at master · n8n-io/n8n · GitHub

Steps

docker build -t n8n-custom -f docker/images/n8n-custom/Dockerfile .
docker volume create n8n_data
docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n n8n-custom

In docker container debug:

ldd $(which node)
        linux-vdso.so.1 (0x00007ffce09e2000)
        libstdc++.so.6 => not found
        libgcc_s.so.1 => /nix/store/19avl2s0rd4whz3b0n118qdrv6yr3b0g-xgcc-13.2.0-libgcc/lib/libgcc_s.so.1 (0x00007f5508a95000)
        libc.musl-x86_64.so.1 => not found
        libc.so.6 => /nix/store/87848rvrg5c7jmplpi0iapvbxyj9kfid-glibc-2.39-52/lib/libc.so.6 (0x00007f5503413000)
        /lib/ld-musl-x86_64.so.1 => /nix/store/87848rvrg5c7jmplpi0iapvbxyj9kfid-glibc-2.39-52/lib64/ld-linux-x86-64.so.2 (0x00007f5508abc000)
which node
/usr/local/bin/node

ls -l /usr/local/lib/node_modules/n8n/bin
total 8
-rwxr-xr-x 1 root root 2633 Feb 14 12:59 n8n
-rwxr-xr-x 1 root root   34 Feb 14 12:59 n8n.cmd


ln -s /usr/local/lib/node_modules/n8n/bin/node /usr/local/bin/node
ln: failed to create symbolic link '/usr/local/bin/node': File exists

What is the error message (if any)?

2025-02-14 16:15:49 env: can’t execute 'node
': No such file or directory

Information on your n8n setup

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

Hey @devhebacc

It looks like the container is telling you the path you are trying to symlink already exists.

Are you making any code changes or just trying to build the image?